diff --git a/package.json b/package.json index d081d897..efe62fba 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "clean": "git clean -Xdf -e !node_modules -e !node_modules/**", "lint": "eslint --ignore-path .gitignore .", "readme": "percy-cli-readme", - "pretest": "storybook build --config-dir=./test/.storybook --output-dir=./test/.storybook-build --loglevel error", + "pretest": "build-storybook --config-dir=./test/.storybook --output-dir=./test/.storybook-build --loglevel error", "test": "yarn test:env jasmine --config=./test/jasmine.json", "test:env": "cross-env NODE_ENV=test NODE_OPTIONS='--loader=./test/loader.js'", "test:coverage": "nyc yarn test" diff --git a/src/start.js b/src/start.js index 66091c4b..46e8e804 100644 --- a/src/start.js +++ b/src/start.js @@ -32,11 +32,11 @@ export const start = command('start', { let { default: { spawn } } = yield import('cross-spawn'); let { host, port } = flags; - let args = ['dev', '--ci', `--host=${host}`, `--port=${port}`, ...argv]; - log.info(`Running "storybook ${args.join(' ')}"`); + let args = ['--ci', `--host=${host}`, `--port=${port}`, ...argv]; + log.info(`Running "start-storybook ${args.join(' ')}"`); let proc = yield new Promise((resolve, reject) => resolve( - spawn('storybook', args, { stdio: 'inherit' }).on('error', reject) + spawn('start-storybook', args, { stdio: 'inherit' }).on('error', reject) )); /* istanbul ignore next: this is a storybook flag we don't need to test */ diff --git a/test/.storybook/main.js b/test/.storybook/main.js index 51af3ea0..a8d7ea6f 100644 --- a/test/.storybook/main.js +++ b/test/.storybook/main.js @@ -2,9 +2,5 @@ module.exports = { stories: ['*.stories.js'], features: { postcss: false - }, - framework: { - name: '@storybook/react-webpack5', - options: {} } }; diff --git a/test/storybook-start.test.js b/test/storybook-start.test.js index 7e1c4739..4161beb9 100644 --- a/test/storybook-start.test.js +++ b/test/storybook-start.test.js @@ -27,7 +27,7 @@ describe('percy storybook:start', () => { ] : []); expect(logger.stdout).toEqual(jasmine.arrayContaining([ - `[percy] Running "storybook dev --ci --host=localhost --port=9000 ${args.join(' ')}"`, + `[percy] Running "start-storybook --ci --host=localhost --port=9000 ${args.join(' ')}"`, '[percy] Percy has started!', '[percy] Snapshot taken: Snapshot: First', '[percy] Snapshot taken: Snapshot: Second', @@ -51,7 +51,7 @@ describe('percy storybook:start', () => { await expectAsync(start([...args])).toBeRejectedWithError('FAKE ENOENT'); expect(logger.stdout).toEqual([ - `[percy] Running "storybook dev --ci --host=localhost --port=9000 ${args.join(' ')}"` + `[percy] Running "start-storybook --ci --host=localhost --port=9000 ${args.join(' ')}"` ]); expect(logger.stderr).toEqual([ '[percy] Error: FAKE ENOENT' diff --git a/test/storybook.test.js b/test/storybook.test.js index 1a50791a..c3d39011 100644 --- a/test/storybook.test.js +++ b/test/storybook.test.js @@ -16,8 +16,7 @@ describe('percy storybook', () => { default: () => [200, 'text/html', '

Not Storybook

'] }); - proc = spawn('storybook', [ - 'dev', + proc = spawn('start-storybook', [ '--config-dir=./test/.storybook', '--port=9000', '--ci'