Nuxt/examples/advanced/testing/tests/basic.test.ts
Clément Ollivier 9a0fc57724
docs: update sitemap (#4063)
Co-authored-by: Sébastien Chopin <seb@nuxtjs.com>
Co-authored-by: pooya parsa <pyapar@gmail.com>
2022-04-06 07:56:08 +02:00

21 lines
532 B
TypeScript

import { fileURLToPath } from 'url'
import { describe, expect, it } from 'vitest'
import { setup, $fetch, isDev } from '@nuxt/test-utils'
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!')
})
if (isDev()) {
it('[dev] ensure vite client script is added', async () => {
expect(await $fetch('/')).toMatch('/_nuxt/@vite/client"')
})
}
})