mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-11 08:33:53 +00:00
fix(test-utils): do not hide vitest output (#9442)
This commit is contained in:
parent
0b6f37f756
commit
3501fd5ca7
@ -59,12 +59,14 @@ export async function loadFixture () {
|
||||
configFile: ctx.options.configFile
|
||||
})
|
||||
|
||||
kit.logger.level = ctx.options.logLevel
|
||||
|
||||
await fsp.mkdir(ctx.nuxt.options.buildDir, { recursive: true })
|
||||
}
|
||||
|
||||
export async function buildFixture () {
|
||||
const ctx = useTestContext()
|
||||
// Hide build info for test
|
||||
const prevLevel = kit.logger.level
|
||||
kit.logger.level = ctx.options.logLevel
|
||||
await kit.buildNuxt(ctx.nuxt!)
|
||||
kit.logger.level = prevLevel
|
||||
}
|
||||
|
@ -1,10 +1,17 @@
|
||||
import * as _kit from '@nuxt/kit'
|
||||
import { createTest, exposeContextToEnv } from '@nuxt/test-utils'
|
||||
|
||||
const hooks = createTest(JSON.parse(process.env.NUXT_TEST_OPTIONS || '{}'))
|
||||
// @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 () => {
|
||||
|
Loading…
Reference in New Issue
Block a user