Skip to content
Permalink
Browse files

fix(jest task): Return error when tests fail

Remove plugin error, returning a message is enough to make the process
emit an error.
  • Loading branch information...
michaelw85 committed Feb 20, 2019
1 parent bfbe072 commit 830bda83dfd30729f1c0cf3f08012c62688c71cd
@@ -15,7 +15,6 @@ module.exports = function(project) {
).addToDevDependencies(
'jest',
'jest-cli',
'plugin-error',
'aurelia-loader-nodejs',
'aurelia-pal-nodejs'
).addNPMScript('test', 'au jest');
@@ -81,7 +81,6 @@
"minimatch": "^3.0.4",
"node-sass": "^4.9.3",
"opn": "^5.4.0",
"plugin-error": "^1.0.1",
"protractor": "^5.4.1",
"requirejs": "^2.3.6",
"sass-loader": "^7.1.0",
@@ -103,4 +102,4 @@
"webpack-cli": "^3.1.2",
"webpack-dev-server": "^3.1.9",
"webpack-hot-middleware": "^2.24.3"
}
}
@@ -1,8 +1,7 @@
import jest from 'jest-cli';
import PluginError from 'plugin-error';
import path from 'path';
import packageJson from '../../package.json';
import {CLIOptions} from 'aurelia-cli';
import { CLIOptions } from 'aurelia-cli';

export default (cb) => {
let options = packageJson.jest;
@@ -15,7 +14,7 @@ export default (cb) => {

jest.runCLI(options, [path.resolve(__dirname, '../../')]).then(({ results }) => {
if (results.numFailedTests || results.numFailedTestSuites) {
cb(new PluginError('jest-cli', { message: 'Tests Failed' }));
cb('Tests Failed');
} else {
cb();
}
@@ -1,9 +1,7 @@
import * as jest from 'jest-cli';
import * as PluginError from 'plugin-error';
import through2 from 'through2';
import * as path from 'path';
import * as packageJson from '../../package.json';
import {CLIOptions} from 'aurelia-cli';
import { CLIOptions } from 'aurelia-cli';

export default (cb) => {
let options = packageJson.jest;
@@ -14,7 +12,7 @@ export default (cb) => {

jest.runCLI(options, [path.resolve(__dirname, '../../')]).then(({ results }) => {
if (results.numFailedTests || results.numFailedTestSuites) {
cb(new PluginError('jest-cli', { message: 'Tests Failed' }));
cb('Tests Failed');
} else {
cb();
}

0 comments on commit 830bda8

Please sign in to comment.
You can’t perform that action at this time.