test: prohibit focused tests/suites on bots (#1686)

This commit is contained in:
Andrey Lushnikov 2017-12-28 15:41:57 -08:00 committed by GitHub
parent 16dc037fc0
commit 508a78d99b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 0 deletions

View File

@ -3428,6 +3428,10 @@ if (process.env.COVERAGE) {
}); });
} }
if (process.env.CI && runner.hasFocusedTestsOrSuites()) {
console.error('ERROR: "focused" tests/suites are prohibitted on bots. Remove any "fit"/"fdescribe" declarations.');
process.exit(1);
}
runner.run(); runner.run();
/** /**
* @param {!EventEmitter} emitter * @param {!EventEmitter} emitter

View File

@ -360,6 +360,10 @@ class TestRunner extends EventEmitter {
return tests; return tests;
} }
hasFocusedTestsOrSuites() {
return this._hasFocusedTestsOrSuites;
}
tests() { tests() {
return this._tests.slice(); return this._tests.slice();
} }