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

Commit

Permalink
fix(test-utils): respect setupTimeout
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Sep 27, 2022
1 parent 2e080c2 commit 1b83a9b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/test-utils/src/context.ts
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
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
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

0 comments on commit 1b83a9b

Please sign in to comment.