mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-16 02:44:51 +00:00
20 lines
501 B
TypeScript
20 lines
501 B
TypeScript
import * as _kit from '@nuxt/kit'
|
|
import { createTest, exposeContextToEnv } from '@nuxt/test-utils'
|
|
|
|
// @ts-ignore type cast
|
|
const kit: typeof _kit = _kit.default || _kit
|
|
|
|
const options = JSON.parse(process.env.NUXT_TEST_OPTIONS || '{}')
|
|
const hooks = createTest(options)
|
|
|
|
export const setup = async () => {
|
|
kit.logger.info('Building Nuxt app...')
|
|
await hooks.setup()
|
|
exposeContextToEnv()
|
|
kit.logger.info('Running tests...')
|
|
}
|
|
|
|
export const teardown = async () => {
|
|
await hooks.afterAll()
|
|
}
|