2022-02-18 18:14:57 +00:00
|
|
|
import { fileURLToPath } from 'url'
|
|
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
import { setup, $fetch } from '@nuxt/test-utils'
|
|
|
|
|
|
|
|
describe('fixtures:bridge', async () => {
|
|
|
|
await setup({
|
|
|
|
rootDir: fileURLToPath(new URL('./fixtures/bridge', import.meta.url)),
|
|
|
|
server: true
|
|
|
|
})
|
|
|
|
|
2022-03-16 21:39:47 +00:00
|
|
|
describe('pages', () => {
|
|
|
|
it('render hello world', async () => {
|
|
|
|
expect(await $fetch('/')).to.contain('Hello Vue 2!')
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
describe('navigate', () => {
|
|
|
|
it('should redirect to index with navigateTo', async () => {
|
|
|
|
const html = await $fetch('/navigate-to/')
|
|
|
|
expect(html).toContain('Hello Vue 2!')
|
|
|
|
})
|
2022-02-18 18:14:57 +00:00
|
|
|
})
|
|
|
|
})
|