mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-22 13:45:18 +00:00
fix(test-utils): respect setupTimeout
(#7866)
This commit is contained in:
parent
d045deb9fd
commit
dab1b114bc
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user