fix(test-utils): respect setupTimeout (#7866)

This commit is contained in:
Daniel Roe 2022-10-03 14:48:03 +01:00 committed by GitHub
parent d045deb9fd
commit dab1b114bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -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,

View File

@ -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

View File

@ -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)