Skip to content

Commit

Permalink
workaround issue caused by defu change
Browse files Browse the repository at this point in the history
  • Loading branch information
rchl committed Oct 31, 2023
1 parent a6397d7 commit 80a98ba
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export async function $$ (selector: string, page: Page): Promise<string | null>
}

export async function loadConfig (dir: string, fixture: string | null = null, override: Record<string, unknown> = {}, { merge = false } = {}): Promise<Record<string, unknown>> {
const config = await import(`${dir}/fixture/${fixture ? fixture + '/' : ''}nuxt.config.cjs`)
// Returned object has "Module" type which defu ignores because it's not plain object.
// Copy properties to the new object so that the object is not ignored.
const config = Object.assign({}, await import(`${dir}/fixture/${fixture ? fixture + '/' : ''}nuxt.config.cjs`))

if (merge) {
return defu(override, config)
Expand Down

0 comments on commit 80a98ba

Please sign in to comment.