From fe81f1b27a0bf5aeceddf0ed9bd024648fe1ea8c Mon Sep 17 00:00:00 2001 From: Ian VanSchooten Date: Thu, 26 Jan 2023 21:42:51 -0500 Subject: [PATCH] Use ipv4 loopback address --- README.md | 4 ++-- bin/test-storybook.js | 4 ++-- src/util/getParsedCliOptions.ts | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 09f0c95c..82f61645 100644 --- a/README.md +++ b/README.md @@ -103,9 +103,9 @@ yarn test-storybook > **NOTE:** The runner assumes that your Storybook is running on port `6006`. If you're running Storybook in another port, either use --url or set the TARGET_URL before running your command like: > > ```jsx -> yarn test-storybook --url http://localhost:9009 +> yarn test-storybook --url http://127.0.0.1:9009 > or -> TARGET_URL=http://localhost:9009 yarn test-storybook +> TARGET_URL=http://127.0.0.1:9009 yarn test-storybook > ``` ## CLI Options diff --git a/bin/test-storybook.js b/bin/test-storybook.js index e0afa2d5..cd88a9fb 100755 --- a/bin/test-storybook.js +++ b/bin/test-storybook.js @@ -133,7 +133,7 @@ async function checkStorybook(url) { If you're not running Storybook on the default 6006 port or want to run the tests against any custom URL, you can pass the --url flag like so: - yarn test-storybook --url http://localhost:9009 + yarn test-storybook --url http://127.0.0.1:9009 More info at https://github.com/storybookjs/test-runner#getting-started` ); @@ -222,7 +222,7 @@ const main = async () => { // set this flag to skip reporting coverage in watch mode isWatchMode = jestOptions.watch || jestOptions.watchAll; - const rawTargetURL = process.env.TARGET_URL || runnerOptions.url || 'http://localhost:6006'; + const rawTargetURL = process.env.TARGET_URL || runnerOptions.url || 'http://127.0.0.1:6006'; await checkStorybook(rawTargetURL); const targetURL = sanitizeURL(rawTargetURL); diff --git a/src/util/getParsedCliOptions.ts b/src/util/getParsedCliOptions.ts index 2890b57e..6f3ec54f 100644 --- a/src/util/getParsedCliOptions.ts +++ b/src/util/getParsedCliOptions.ts @@ -27,7 +27,7 @@ export const getParsedCliOptions = () => { .option( '--url ', 'Define the URL to run tests in. Useful for custom Storybook URLs', - 'http://localhost:6006' + 'http://127.0.0.1:6006' ) .option( '--maxWorkers ',