mirror of
https://github.com/storybookjs/storybook.git
synced 2025-03-16 05:03:11 +08:00
fix: supply arg to execute conditionally
This commit is contained in:
parent
983e4c16e7
commit
8d5f1e0eaf
@ -26,12 +26,12 @@ describe('sb init', () => {
|
||||
|
||||
// Install all the dependencies in a single run
|
||||
console.log('Running bootstrap');
|
||||
run(['yarn install', '--non-interactive', '--silent', '--pure-lockfile'], { cwd: rootPath });
|
||||
run(['yarn', 'install', '--non-interactive', '--silent', '--pure-lockfile'], { cwd: rootPath }, false);
|
||||
|
||||
// Check that storybook starts without errors
|
||||
dirs.forEach(dir => {
|
||||
console.log(`Running smoke test in ${dir}`)
|
||||
const { status } = run(['yarn', 'storybook', '--smoke-test', '--quiet'], { cwd: path.join(runDirPath, dir) });
|
||||
const { status } = run(['yarn', 'storybook', '--smoke-test', '--quiet'], { cwd: path.join(runDirPath, dir) }, false);
|
||||
expect(status).toBe(0);
|
||||
});
|
||||
});
|
||||
|
@ -55,7 +55,7 @@ const copyDirSync = (source, target) => {
|
||||
* @param {Boolean} [cli=true] - invoke the binary
|
||||
* @returns {Object}
|
||||
*/
|
||||
const run = (args, options = {}, cli = true) => spawnSync('node', cli ? [CLI_PATH].concat(args) : args, options);
|
||||
const run = (args, options = {}, cli = true) => spawnSync(cli ? 'node' : args[0], cli ? [CLI_PATH].concat(args) : args.slice(1), options);
|
||||
|
||||
module.exports = {
|
||||
copyDirSync,
|
||||
|
Loading…
x
Reference in New Issue
Block a user