Skip to content

Commit df69227

Browse files
committed
Report on failed build tests.
1 parent f13cb14 commit df69227

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

scripts/ciTest.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ function runTests() {
113113
encoding: "utf8",
114114
});
115115
var files = fs.readdirSync(buildTestDir);
116+
var failed = [];
116117
files.forEach(function (file) {
117118
var testDir = path.join(buildTestDir, file);
118119
if (file === "node_modules" || !fs.lstatSync(testDir).isDirectory()) {
@@ -127,10 +128,16 @@ function runTests() {
127128
cp.execSync(`node input.js`, { cwd: testDir, encoding: "utf8" });
128129
console.log("✅ success in ", file);
129130
} catch (e) {
130-
console.log("⚠️ error", e)
131+
failed.push(file);
132+
console.log("❌ error", e)
131133
};
132134
}
133135
});
136+
if (failed.length > 0) {
137+
console.log("");
138+
console.log ("❌ Build tests failed", failed);
139+
throw(new Error());
140+
}
134141
}
135142
}
136143

0 commit comments

Comments
 (0)