Skip to content

Commit

Permalink
Merge pull request #51 from storybookjs/fix/improve-error-message
Browse files Browse the repository at this point in the history
fix: improve error message in start-storybook
  • Loading branch information
yannbf committed Feb 15, 2022
2 parents 1385125 + 963e230 commit ab46d8c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions bin/test-storybook.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

const fetch = require('node-fetch');
const fs = require('fs');
const dedent = require('ts-dedent').default;
const path = require('path');
const tempy = require('tempy');
const { getCliOptions, getStorybookMetadata } = require('../dist/cjs/util');
Expand Down Expand Up @@ -71,7 +72,13 @@ async function checkStorybook(url) {
if (res.status !== 200) throw new Error(`Unxpected status: ${res.status}`);
} catch (e) {
console.error(
`[test-storybook] It seems that your Storybook instance is not running at: ${url}. Are you sure it's running?`
dedent`[test-storybook] It seems that your Storybook instance is not running at: ${url}. Are you sure it's running?
If you're not running Storybook on the default 6006 port or want to run the tests against any custom URL, you can set the TARGET_URL variable like so:
TARGET_URL=http://localhost:9009 yarn test-storybook
More info at https://github.com/storybookjs/test-runner#getting-started`
);
process.exit(1);
}
Expand Down Expand Up @@ -114,7 +121,7 @@ const main = async () => {
}

process.env.STORYBOOK_CONFIG_DIR = runnerOptions.configDir;

const { storiesPaths } = getStorybookMetadata();
process.env.STORYBOOK_STORIES_PATTERN = storiesPaths;

Expand Down

0 comments on commit ab46d8c

Please sign in to comment.