Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX yarn test & selecting only core #2219

Merged
merged 1 commit into from
Nov 2, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions scripts/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const program = require('commander');
const childProcess = require('child_process');
const chalk = require('chalk');
const log = require('npmlog');
const path = require('path');

log.heading = 'storybook';
const prefix = 'test';
Expand All @@ -18,6 +19,7 @@ const spawn = command => {
if (out.status !== 0) {
process.exit(out.status);
}

return out;
};

Expand All @@ -43,7 +45,7 @@ const tasks = {
name: `Core & React & Vue ${chalk.gray('(core)')}`,
defaultValue: true,
option: '--core',
projectLocation: './',
projectLocation: path.join(__dirname, '..'),
}),
'react-native-vanilla': createProject({
name: `React-Native example ${chalk.gray('(react-native-vanilla)')}`,
Expand Down Expand Up @@ -110,6 +112,7 @@ Object.keys(tasks).forEach(key => {
});

let selection;

if (
!Object.keys(tasks)
.map(key => tasks[key].value)
Expand Down Expand Up @@ -153,10 +156,14 @@ if (

selection
.then(list => {
const command = `jest --projects ${getProjects(list).join(' ')} ${getExtraParams(list).join(
' '
)}`;
console.log('command: ', command);
if (list.length === 0) {
log.warn(prefix, 'Nothing to test');
} else {
spawn(`jest --projects ${getProjects(list).join(' ')} ${getExtraParams(list).join(' ')}`);
spawn(command);
process.stdout.write('\x07');
}
})
Expand Down