mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-16 10:54:49 +00:00
27 lines
662 B
TypeScript
27 lines
662 B
TypeScript
import { fileURLToPath } from 'node:url'
|
|
import { describe, expect, it } from 'vitest'
|
|
import { normalize } from 'pathe'
|
|
import { withoutTrailingSlash } from 'ufo'
|
|
import { loadNuxt } from '../src'
|
|
|
|
const repoRoot = withoutTrailingSlash(normalize(fileURLToPath(new URL('../../../', import.meta.url))))
|
|
|
|
describe('loadNuxt', () => {
|
|
it('respects hook overrides', async () => {
|
|
let hookRan = false
|
|
const nuxt = await loadNuxt({
|
|
cwd: repoRoot,
|
|
ready: true,
|
|
overrides: {
|
|
hooks: {
|
|
ready () {
|
|
hookRan = true
|
|
},
|
|
},
|
|
},
|
|
})
|
|
await nuxt.close()
|
|
expect(hookRan).toBe(true)
|
|
})
|
|
})
|