Skip to content

Commit 4b9c727

Browse files
committed
Add package-lock.json files to user tests
1 parent 98492d8 commit 4b9c727

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ internal/
7272
yarn.lock
7373
yarn-error.log
7474
.parallelperf.*
75-
tests/cases/user/*/package-lock.json
7675
tests/cases/user/*/node_modules/
7776
tests/cases/user/*/**/*.js
7877
tests/cases/user/*/**/*.js.map

src/testRunner/externalCompileRunner.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,19 @@ namespace Harness {
5959
exec("git", ["--work-tree", submoduleDir, "clone", config.cloneUrl, path.join(submoduleDir, ".git")], { cwd });
6060
}
6161
else {
62-
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "reset", "HEAD", "--hard"], { cwd: submoduleDir });
63-
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "clean", "-f"], { cwd: submoduleDir });
64-
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "pull", "-f"], { cwd: submoduleDir });
62+
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "checkout", ":^package-lock.json"], { cwd: submoduleDir });
63+
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "clean", "--force", ":^package-lock.json"], { cwd: submoduleDir });
64+
if (!process.env.SOURCE_ISSUE) {
65+
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "pull"], { cwd: submoduleDir });
66+
}
6567
}
6668

6769
types = config.types;
6870

6971
cwd = config.path ? path.join(cwd, config.path) : submoduleDir;
7072
}
7173
if (fs.existsSync(path.join(cwd, "package.json"))) {
72-
if (fs.existsSync(path.join(cwd, "package-lock.json"))) {
74+
if (!process.env.SOURCE_ISSUE && fs.existsSync(path.join(cwd, "package-lock.json"))) {
7375
fs.unlinkSync(path.join(cwd, "package-lock.json"));
7476
}
7577
if (fs.existsSync(path.join(cwd, "node_modules"))) {

0 commit comments

Comments
 (0)