mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
31 lines
567 B
JavaScript
31 lines
567 B
JavaScript
'use strict';
|
|
|
|
const path = require('path');
|
|
const spawn = require('child_process').spawn;
|
|
|
|
console.log('running jest');
|
|
|
|
const args = [
|
|
path.join('node_modules', 'jest-cli', 'bin', 'jest'),
|
|
'--runInBand',
|
|
];
|
|
// if (coverage) {
|
|
// args.push('--coverage');
|
|
// }
|
|
|
|
const jest = spawn('node', args, {
|
|
stdio: 'inherit',
|
|
env: Object.assign({}, process.env, {
|
|
NODE_ENV: 'test',
|
|
}),
|
|
});
|
|
|
|
jest.on('close', (code) => {
|
|
if (code === 1) {
|
|
console.error('jest failed');
|
|
} else {
|
|
console.log('jest passed');
|
|
}
|
|
process.exit(0);
|
|
});
|