2018-08-27 06:31:38 -04:00
|
|
|
// We can't use `import...from` here, because of the following mess:
|
|
|
|
// - GitHub project `jasmine/jasmine` is `jasmine-core` on npm and its typings `@types/jasmine`.
|
|
|
|
// - GitHub project `jasmine/jasmine-npm` is `jasmine` on npm and has no typings.
|
|
|
|
//
|
|
|
|
// Using `import...from 'jasmine'` here, would import from `@types/jasmine` (which refers to the
|
|
|
|
// `jasmine-core` module and the `jasmine` module).
|
|
|
|
import Jasmine = require('jasmine');
|
2018-08-27 07:56:56 -04:00
|
|
|
import 'source-map-support/register';
|
2018-08-27 06:31:38 -04:00
|
|
|
|
|
|
|
export const runTests = (specFiles: string[]) => {
|
2017-02-06 13:40:28 -05:00
|
|
|
const config = {
|
|
|
|
random: true,
|
|
|
|
spec_files: specFiles,
|
|
|
|
stopSpecOnExpectationFailure: true,
|
|
|
|
};
|
|
|
|
|
|
|
|
process.on('unhandledRejection', (reason: any) => console.log('Unhandled rejection:', reason));
|
|
|
|
|
2018-08-27 06:31:38 -04:00
|
|
|
const runner = new Jasmine({});
|
2017-02-06 13:40:28 -05:00
|
|
|
runner.loadConfig(config);
|
|
|
|
runner.onComplete((passed: boolean) => process.exit(passed ? 0 : 1));
|
|
|
|
runner.execute();
|
|
|
|
};
|