Mailspring/app/spec/spec-runner/terminal-reporter.es6

21 lines
511 B
Text
Raw Normal View History

2016-10-15 04:33:27 +08:00
import { remote } from 'electron';
2017-09-27 02:33:08 +08:00
import { TerminalReporter } from 'jasmine-tagged';
2016-10-15 04:33:27 +08:00
export default class N1TerminalReporter extends TerminalReporter {
constructor(opts = {}) {
const options = Object.assign(opts, {
color: true,
print(str) {
return remote.process.stdout.write(str);
},
onComplete(runner) {
if (runner.results().failedCount > 0) {
2017-09-27 02:36:58 +08:00
return AppEnv.exit(1);
2016-10-15 04:33:27 +08:00
}
2017-09-27 02:36:58 +08:00
return AppEnv.exit(0);
2016-10-15 04:33:27 +08:00
},
});
2017-09-27 02:33:08 +08:00
super(options);
2016-10-15 04:33:27 +08:00
}
}