Skip to content

Commit

Permalink
Refactor extension handling for workspace file
Browse files Browse the repository at this point in the history
  • Loading branch information
valentinpalkovic committed Jan 8, 2025
1 parent 5affbc2 commit 39c08e9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions code/addons/test/src/node/vitest-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { StorybookReporter } from './reporter';
import type { TestManager } from './test-manager';

const VITEST_CONFIG_FILE_EXTENSIONS = ['mts', 'mjs', 'cts', 'cjs', 'ts', 'tsx', 'js', 'jsx'];
const VITEST_WORKSPACE_FILE_EXTENSION = ['ts', 'js', 'json'];

type TagsFilter = {
include: string[];
Expand Down Expand Up @@ -72,9 +73,7 @@ export class VitestManager {
) as CoverageOptions;

const vitestWorkspaceConfig = await findUp([
'vitest.workspace.ts',
'vitest.workspace.js',
'vitest.workspace.json',
...VITEST_WORKSPACE_FILE_EXTENSION.map((ext) => `vitest.workspace.${ext}`),
...VITEST_CONFIG_FILE_EXTENSIONS.map((ext) => `vitest.config.${ext}`),
]);

Expand Down

0 comments on commit 39c08e9

Please sign in to comment.