Skip to content

Commit 8f3c735

Browse files
committed
Pass configDir and enableCrashReports
1 parent 2963dac commit 8f3c735

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

src/test-storybook.ts

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,8 @@ const main = async () => {
377377
process.env.TEST_MATCH = '**/*.test.js';
378378
}
379379

380-
const { storiesPaths, lazyCompilation, disableTelemetry } = getStorybookMetadata();
380+
const { storiesPaths, lazyCompilation, disableTelemetry, enableCrashReports } =
381+
getStorybookMetadata();
381382
if (!shouldRunIndexJson) {
382383
process.env.STORYBOOK_STORIES_PATTERN = storiesPaths;
383384

@@ -399,11 +400,18 @@ const main = async () => {
399400
if (!disableTelemetry && !runnerOptions.disableTelemetry) {
400401
// NOTE: we start telemetry immediately but do not wait on it. Typically it should complete
401402
// before the tests do. If not we may miss the event, we are OK with that.
402-
// @ts-expect-error -- need to update storybook version
403-
telemetry('test-run', {
404-
runner: 'test-runner',
405-
watch: jestOptions.includes('--watch'),
406-
});
403+
telemetry(
404+
// @ts-expect-error -- need to update storybook version
405+
'test-run',
406+
{
407+
runner: 'test-runner',
408+
watch: jestOptions.includes('--watch'),
409+
},
410+
{
411+
configDir: runnerOptions.configDir,
412+
enableCrashReports,
413+
}
414+
);
407415
}
408416

409417
await executeJestPlaywright(jestOptions);

src/util/getStorybookMetadata.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const getStorybookMetadata = () => {
2626
const lazyCompilation = !!main.core?.builder?.options?.lazyCompilation;
2727

2828
// @ts-expect-error -- need to update to latest sb version
29-
const disableTelemetry = !!main.core?.disableTelemetry;
29+
const { disableTelemetry, enableCrashReports } = !!main.core || {};
3030

3131
return {
3232
configDir,
@@ -35,5 +35,6 @@ export const getStorybookMetadata = () => {
3535
normalizedStoriesEntries,
3636
lazyCompilation,
3737
disableTelemetry,
38+
enableCrashReports,
3839
};
3940
};

0 commit comments

Comments
 (0)