mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
27 lines
796 B
TypeScript
27 lines
796 B
TypeScript
|
import { fileURLToPath } from 'node:url'
|
||
|
import { bench, describe } from 'vitest'
|
||
|
import { normalize } from 'pathe'
|
||
|
import { withoutTrailingSlash } from 'ufo'
|
||
|
import { loadNuxt } from '../src'
|
||
|
|
||
|
const emptyDir = withoutTrailingSlash(normalize(fileURLToPath(new URL('../../../node_modules/fixture', import.meta.url))))
|
||
|
const basicTestFixtureDir = withoutTrailingSlash(normalize(fileURLToPath(new URL('../../../test/fixtures/basic', import.meta.url))))
|
||
|
|
||
|
describe('loadNuxt', () => {
|
||
|
bench('empty directory', async () => {
|
||
|
const nuxt = await loadNuxt({
|
||
|
cwd: emptyDir,
|
||
|
ready: true
|
||
|
})
|
||
|
await nuxt.close()
|
||
|
})
|
||
|
|
||
|
bench('basic test fixture', async () => {
|
||
|
const nuxt = await loadNuxt({
|
||
|
cwd: basicTestFixtureDir,
|
||
|
ready: true
|
||
|
})
|
||
|
await nuxt.close()
|
||
|
})
|
||
|
})
|