build(docs-infra): ensure that jasmine node tests fail on build error (#41596)
Previously if there was a problem when building the tests, the error would be swallowed as an unhandled promise rejection. Now these are caught and the process is exited with a non-zero value to prevent any CI jobs from passing incorrectly. PR Close #41596
This commit is contained in:
parent
b3d9dea52b
commit
60d023449b
|
@ -18,4 +18,8 @@ register({project: join(__dirname, 'tsconfig.json')});
|
|||
|
||||
const runner = new Jasmine({projectBaseDir: __dirname});
|
||||
runner.loadConfig({spec_files: ['**/*.spec.ts']});
|
||||
runner.execute();
|
||||
runner.execute().catch((error) => {
|
||||
// Something broke so non-zero exit to prevent the process from succeeding.
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
|
|
@ -14,4 +14,8 @@
|
|||
const Jasmine = require('jasmine');
|
||||
const jasmine = new Jasmine({ projectBaseDir: __dirname });
|
||||
jasmine.loadConfig({ spec_files: ['*.spec.js'] });
|
||||
jasmine.execute();
|
||||
jasmine.execute().catch((error) => {
|
||||
// Something broke so non-zero exit to prevent the process from succeeding.
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
|
|
@ -18,4 +18,8 @@ register({project: join(__dirname, 'tsconfig.json')});
|
|||
|
||||
const runner = new Jasmine({projectBaseDir: __dirname});
|
||||
runner.loadConfig({spec_files: ['**/*.spec.ts']});
|
||||
runner.execute();
|
||||
runner.execute().catch((error) => {
|
||||
// Something broke so non-zero exit to prevent the process from succeeding.
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
|
|
@ -14,4 +14,8 @@
|
|||
const Jasmine = require('jasmine');
|
||||
const jasmine = new Jasmine({ projectBaseDir: __dirname });
|
||||
jasmine.loadConfig({ random: true, spec_files: ['**/*.spec.js'] });
|
||||
jasmine.execute();
|
||||
jasmine.execute().catch((error) => {
|
||||
// Something broke so non-zero exit to prevent the process from succeeding.
|
||||
console.error(error);
|
||||
process.exit(1);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue