diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index fc7131cc2..d5b8792c1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1320,6 +1320,9 @@ importers: jest-image-snapshot: specifier: ^6.5.2 version: 6.5.2 + magic-string: + specifier: 'catalog:' + version: 1.4.2 obug: specifier: ^3.0.0 version: 3.0.0 diff --git a/test/e2e/package.json b/test/e2e/package.json index 05c86bb4f..0ad58ba4a 100644 --- a/test/e2e/package.json +++ b/test/e2e/package.json @@ -36,6 +36,7 @@ "flatted": "catalog:", "inline-dep": "file:./deps/vite-ssr-resolve/inline-dep", "jest-image-snapshot": "^6.5.2", + "magic-string": "catalog:", "obug": "^3.0.0", "other-dep": "file:./deps/vite-ssr-resolve/other-dep", "pathe": "catalog:", diff --git a/test/unit/test/module-diagnostic.test.ts b/test/e2e/test/module-diagnostic.test.ts similarity index 95% rename from test/unit/test/module-diagnostic.test.ts rename to test/e2e/test/module-diagnostic.test.ts index db8e6d3cf..e1cc5af76 100644 --- a/test/unit/test/module-diagnostic.test.ts +++ b/test/e2e/test/module-diagnostic.test.ts @@ -81,12 +81,7 @@ function normalizeUntrackedModules( } describe('experimental_getSourceModuleDiagnostic', () => { - test('Static imports and re-exports should receive source locations and duration information', async ({ - skip, - task, - }) => { - skip(task.file.pool !== 'threads', 'run only once inside threads') - + test('Static imports and re-exports should receive source locations and duration information', async () => { const source = ` import { expect, test } from 'vitest' import { value } from './dependency.js' @@ -157,12 +152,7 @@ test('uses an imported value', () => { `) }) - test('Importing the same resolved module twice should not count its loading cost twice.', async ({ - skip, - task, - }) => { - skip(task.file.pool !== 'threads', 'run only once inside threads') - + test('Importing the same resolved module twice should not count its loading cost twice.', async () => { const source = ` import { expect, test } from 'vitest' import { value } from './dependency.js' @@ -239,9 +229,7 @@ test('uses both imports', () => { `) }) - test('non transformed modules should return an empty diagnostic', async ({ skip, task }) => { - skip(task.file.pool !== 'threads', 'run only once inside threads') - + test('non transformed modules should return an empty diagnostic', async () => { const source = ` import { expect, test } from 'vitest' import { value } from './used.js' @@ -265,12 +253,7 @@ test('uses an imported value', () => { }) }) - test('should aggregate durations from all test modules when no testModule is provided', async ({ - skip, - task, - }) => { - skip(task.file.pool !== 'threads', 'run only once inside threads') - + test('should aggregate durations from all test modules when no testModule is provided', async () => { const sharedSource = ` import { value } from './dependency.js' export const shared = value @@ -365,12 +348,7 @@ test('second test', () => expect(shared).toBe(42)) `) }) - test('should report imports that are injected during transformation as untracked', async ({ - skip, - task, - }) => { - skip(task.file.pool !== 'threads', 'run only once inside threads') - + test('should report imports that are injected during transformation as untracked', async () => { const originalImport = "import './original.js'" const source = ` ${originalImport}