2022-04-15 15:19:05 +00:00
|
|
|
import { fileURLToPath } from 'node:url'
|
2022-03-16 12:34:27 +00:00
|
|
|
import { describe, expect, it } from 'vitest'
|
2022-03-17 21:31:06 +00:00
|
|
|
import { setup, $fetch, isDev } from '@nuxt/test-utils'
|
2022-03-16 12:34:27 +00:00
|
|
|
|
|
|
|
describe('example', async () => {
|
|
|
|
await setup({
|
|
|
|
rootDir: fileURLToPath(new URL('..', import.meta.url)),
|
|
|
|
server: true
|
|
|
|
})
|
|
|
|
|
|
|
|
it('Renders Hello Nuxt', async () => {
|
|
|
|
expect(await $fetch('/')).toMatch('Hello Nuxt!')
|
|
|
|
})
|
2022-03-17 21:31:06 +00:00
|
|
|
|
|
|
|
if (isDev()) {
|
|
|
|
it('[dev] ensure vite client script is added', async () => {
|
|
|
|
expect(await $fetch('/')).toMatch('/_nuxt/@vite/client"')
|
|
|
|
})
|
|
|
|
}
|
2022-03-16 12:34:27 +00:00
|
|
|
})
|