Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(test-utils): respect setupTimeout #7866

Merged
merged 1 commit into from
Oct 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/test-utils/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export function createTestContext (options: Partial<TestOptions>): TestContext {
testDir: resolve(process.cwd(), 'test'),
fixture: 'fixture',
configFile: 'nuxt.config',
setupTimeout: 60000,
setupTimeout: 120 * 1000,
dev: !!JSON.parse(process.env.NUXT_TEST_DEV || 'false'),
logLevel: 1,
server: true,
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/src/setup/jest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default async function setupJest (hooks: TestHooks) {

// TODO: add globals existing check to provide better error message
// @ts-expect-error jest types
test('setup', hooks.setup, 120 * 1000)
test('setup', hooks.setup, hooks.ctx.options.setupTimeout)
// @ts-expect-error jest types
beforeEach(hooks.beforeEach)
// @ts-expect-error jest types
Expand Down
2 changes: 1 addition & 1 deletion packages/test-utils/src/setup/vitest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export default async function setupVitest (hooks: TestHooks) {

hooks.ctx.mockFn = vitest.vi.fn

vitest.beforeAll(hooks.setup, 120 * 1000)
vitest.beforeAll(hooks.setup, hooks.ctx.options.setupTimeout)
vitest.beforeEach(hooks.beforeEach)
vitest.afterEach(hooks.afterEach)
vitest.afterAll(hooks.afterAll)
Expand Down