Skip to content

Commit

Permalink
Merge branch 'norbert/sb-9-compatibility' of github.com:storybookjs/t…
Browse files Browse the repository at this point in the history
…est-runner into norbert/sb-9-compatibility
  • Loading branch information
ndelangen committed Feb 26, 2025
2 parents 3b915c2 + 661e523 commit f6e12a2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ Usage: test-storybook [options]
| `--json` | Prints the test results in JSON. This mode will send all other test output and user messages to stderr. <br/>`test-storybook --json` |
| `--outputFile` | Write test results to a file when the --json option is also specified. <br/>`test-storybook --json --outputFile results.json` |
| `--junit` | Indicates that test information should be reported in a junit file. <br/>`test-storybook --**junit**` |
| `--listTests` | Lists all test files that will be run, and exits<br/>`test-storybook --listTests` |
| `--listTests` | Lists all test files that will be run, and exits<br/>`test-storybook --listTests` |
| `--ci` | Instead of the regular behavior of storing a new snapshot automatically, it will fail the test and require Jest to be run with `--updateSnapshot`. <br/>`test-storybook --ci` |
| `--shard [shardIndex/shardCount]` | Splits your test suite across different machines to run in CI. <br/>`test-storybook --shard=1/3` |
| `--failOnConsole` | Makes tests fail on browser console errors<br/>`test-storybook --failOnConsole` |
Expand Down
4 changes: 2 additions & 2 deletions src/playwright/transformPlaywrightJson.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ function v3TitleMapToV4TitleMap(titleIdToStories: Record<string, V3Story[]>) {
type: isV3DocsOnly(stories) ? 'docs' : 'story',
tags: isV3DocsOnly(stories) ? [] : ['test', 'dev'],
...story,
} satisfies V4Entry)
}) satisfies V4Entry
),
])
);
Expand All @@ -121,7 +121,7 @@ function v4TitleMapToV5TitleMap(titleIdToStories: Record<string, V4Entry[]>) {
({
...story,
tags: story.tags ? ['test', 'dev', ...story.tags] : ['test', 'dev'],
} satisfies V4Entry)
}) satisfies V4Entry
),
])
);
Expand Down
5 changes: 1 addition & 4 deletions src/setup-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@ export const setupPage = async (page: Page, browserContext: BrowserContext) => {
const failOnConsole = process.env.TEST_CHECK_CONSOLE;

const viewMode = process.env.VIEW_MODE ?? 'story';
const renderedEvent =
viewMode === 'docs'
? 'globalThis.__STORYBOOK_MODULE_CORE_EVENTS__.DOCS_RENDERED'
: 'globalThis.__STORYBOOK_MODULE_CORE_EVENTS__.STORY_FINISHED ?? globalThis.__STORYBOOK_MODULE_CORE_EVENTS__.STORY_RENDERED';
const renderedEvent = viewMode === 'docs' ? 'globalThis.__STORYBOOK_MODULE_CORE_EVENTS__.DOCS_RENDERED' : 'globalThis.__STORYBOOK_MODULE_CORE_EVENTS__.STORY_FINISHED ?? globalThis.__STORYBOOK_MODULE_CORE_EVENTS__.STORY_RENDERED';
const { packageJson } = (await readPackageUp()) as NormalizedReadResult;
const { version: testRunnerVersion } = packageJson;

Expand Down
5 changes: 4 additions & 1 deletion src/util/getParsedCliOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,10 @@ export const getParsedCliOptions = (): ParsedCliOptions => {
'coverage/storybook'
)
.option('--junit', 'Indicates that test information should be reported in a junit file')
.option('--listTests', 'Lists all test files that will be run, and exits')
.option(
'--listTests',
'Lists all test files that will be run, and exits'
)
.option(
'--eject',
'Creates a local configuration file to override defaults of the test-runner. Use it only if you want to have better control over the runner configurations'
Expand Down

0 comments on commit f6e12a2

Please sign in to comment.