Skip to content

Commit 742ffe4

Browse files
fix(test_downstream_projects): Run tests and downstream tests separately. Switch back to .downstream_cache dir before prepping nested downstream projects
1 parent ccb2c30 commit 742ffe4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test_downstream_projects.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ function installUpstreamDeps() {
5050

5151
function runTests() {
5252
util._exec(`UPSTREAM_PKGS="${UPSTREAM_PKGS.join(',')}" npm test`);
53+
}
5354

55+
function runDownstreamTests() {
5456
const downstreamPkgJson = JSON.parse(fs.readFileSync('package.json'));
5557
const hasDownstreamTests = downstreamPkgJson.scripts && !!downstreamPkgJson.scripts['test:downstream'];
5658

@@ -97,14 +99,18 @@ try {
9799
console.log(` ===> Moving downstream project '${key}' to temp dir '${TEMP_DIR}' <===`);
98100
shelljs.mv(DOWNSTREAM_PACKAGE_DIR, TEMP_DIR);
99101

100-
console.log(` ===> Running downstream tests <===`);
102+
console.log(` ===> Running '${key}' tests <===`);
101103
process.chdir(DOWNSTREAM_PACKAGE_TEMP_DIR);
102104
runTests();
103105
} finally {
104106
console.log(` ===> Moving downstream project '${key}' back from temp dir <===`);
105107
shelljs.mv(DOWNSTREAM_PACKAGE_TEMP_DIR, DOWNSTREAM_CACHE);
106108
}
107109

110+
console.log(` ===> Running '${key}' downstream tests <===`);
111+
process.chdir(DOWNSTREAM_PACKAGE_DIR);
112+
runDownstreamTests();
113+
108114
console.log(` ===> Cleaning downstream project '${key}' <===`);
109115
process.chdir(DOWNSTREAM_PACKAGE_DIR);
110116
revertLocalChanges(installSource);

0 commit comments

Comments
 (0)