diff --git a/examples/app-vitest/test/e2e/dev-concurrent.spec.ts b/examples/app-vitest/test/e2e/dev-concurrent.spec.ts index 714d335b2..5cdd61dd8 100644 --- a/examples/app-vitest/test/e2e/dev-concurrent.spec.ts +++ b/examples/app-vitest/test/e2e/dev-concurrent.spec.ts @@ -1,15 +1,12 @@ import { fileURLToPath } from 'node:url' -import { createTest, setTestContext } from '@nuxt/test-utils/e2e' +import { createTest } from '@nuxt/test-utils/e2e' import { afterAll, beforeAll, describe, expect, it } from 'vitest' const rootDir = fileURLToPath(new URL('../../', import.meta.url)) const servers = [createTest({ rootDir, dev: true }), createTest({ rootDir, dev: true })] for (const server of servers) { - beforeAll(async () => { - setTestContext(server.ctx) - await server.beforeAll() - }, server.ctx.options.setupTimeout) + beforeAll(server.beforeAll, server.ctx.options.setupTimeout) afterAll(server.afterAll, server.ctx.options.teardownTimeout) } diff --git a/examples/module/test/multiple-setup.test.ts b/examples/module/test/multiple-setup.test.ts new file mode 100644 index 000000000..a0b926aa7 --- /dev/null +++ b/examples/module/test/multiple-setup.test.ts @@ -0,0 +1,16 @@ +import { fileURLToPath } from 'node:url' +import { describe, expect, it } from 'vitest' +import { $fetch, setup } from '@nuxt/test-utils/e2e' + +for (const fixture of ['basic', 'dot-config']) { + describe(fixture, async () => { + await setup({ + rootDir: fileURLToPath(new URL(`./fixtures/${fixture}`, import.meta.url)), + }) + + it('renders the index page', async () => { + const html = await $fetch('/') + expect(html).toContain(`