react/scripts/release/build-commands/run-automated-tests.js
Dan Abramov f53bd033e7
Fix Jest call in the release script
Just running jest binary will no longer work
2017-11-25 16:13:28 +00:00

35 lines
707 B
JavaScript

#!/usr/bin/env node
'use strict';
const chalk = require('chalk');
const {exec} = require('child-process-promise');
const {logPromise} = require('../utils');
const runYarnTask = async (cwd, task, errorMessage) => {
try {
await exec(`yarn ${task}`, {cwd});
} catch (error) {
throw Error(
chalk`
${errorMessage}
{white ${error.stdout}}
`
);
}
};
module.exports = async ({cwd}) => {
await logPromise(runYarnTask(cwd, 'lint', 'Lint failed'), 'Running ESLint');
await logPromise(
runYarnTask(cwd, 'flow', 'Flow failed'),
'Running Flow checks'
);
await logPromise(
runYarnTask(cwd, 'test', 'Jest failed'),
'Running Jest tests',
true
);
};