Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion scripts/build/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,23 @@ async function runConsoleTests(runJs, defaultReporter, runInParallel, watchMode,
// timeout normally isn"t necessary but Travis-CI has been timing out on compiler baselines occasionally
// default timeout is 2sec which really should be enough, but maybe we just need a small amount longer
if (!runInParallel) {
args.push(failed ? "scripts/run-failed-tests.js" : mochaJs);
args.push(mochaJs);
args.push("-R", "scripts/failed-tests");
args.push("-O", '"reporter=' + reporter + (keepFailed ? ",keepFailed=true" : "") + '"');
if (tests) {
args.push("-g", `"${tests}"`);
}
if (failed) {
const grep = fs.readFileSync(".failed-tests", "utf8")
.split(/\r?\n/g)
.map(test => test.trim())
.filter(test => test.length > 0)
.map(regExpEscape)
.join("|");
const file = path.join(os.tmpdir(), ".failed-tests.json");
fs.writeFileSync(file, JSON.stringify({ grep }), "utf8");
args.push("--config", file);
}
if (colors) {
args.push("--colors");
}
Expand Down Expand Up @@ -203,3 +214,7 @@ function restoreSavedNodeEnv() {
function deleteTemporaryProjectOutput() {
return del(path.join(exports.localBaseline, "projectOutput/"));
}

function regExpEscape(text) {
return text.replace(/[.*+?^${}()|\[\]\\]/g, '\\$&');
}
97 changes: 0 additions & 97 deletions scripts/run-failed-tests.js

This file was deleted.