fix(test-utils): allow overriding nitro options (#19872)

This commit is contained in:
pooya parsa 2023-03-23 01:27:13 +01:00 committed by GitHub
parent 824d296c7b
commit dc5982d9e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,5 +1,6 @@
import { existsSync, promises as fsp } from 'node:fs'
import { resolve } from 'node:path'
import { defu } from 'defu'
import * as _kit from '@nuxt/kit'
import { useTestContext } from './context'
@ -43,7 +44,7 @@ export async function loadFixture () {
if (!ctx.options.dev) {
const randomId = Math.random().toString(36).slice(2, 8)
const buildDir = resolve(ctx.options.rootDir, '.nuxt', randomId)
Object.assign(ctx.options.nuxtConfig, {
ctx.options.nuxtConfig = defu(ctx.options.nuxtConfig, {
buildDir,
nitro: {
output: {