Skip to content

Commit

Permalink
FIX yarn test & selecting only core
Browse files Browse the repository at this point in the history
This was broken by some internal change by jest or something.
By proving a absolute path this seems to work again.

Added the executed command for clearity.
  • Loading branch information
ndelangen committed Nov 2, 2017
1 parent c2df1a1 commit 238338f
Showing 1 changed file with 9 additions and 2 deletions.
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

0 comments on commit 238338f

Please sign in to comment.