Nuxt/test/examples/hello-world.test.ts
pooya parsa c53c7360b7
feat: @nuxt/test-utils (#2952)
Co-authored-by: Anthony Fu <anthonyfu117@hotmail.com>
2022-02-11 14:22:58 +01:00

20 lines
554 B
TypeScript

import { fileURLToPath } from 'url'
import { resolve } from 'path'
import { describe, expect, it } from 'vitest'
// TODO: Should import from @nuxt/test-utils
import { setup, $fetch } from '../../packages/test-utils/src'
const examplesDir = fileURLToPath(new URL('../../examples', import.meta.url))
await setup({
rootDir: resolve(examplesDir, 'hello-world'),
runner: 'vitest',
server: true
})
describe('examples:hello-world', () => {
it('Render hello world test', async () => {
expect(await $fetch('/')).to.contain('Hello Nuxt 3!')
})
})