import { fileURLToPath } from 'url' import { describe, expect, it } from 'vitest' import { setup, $fetch } from '@nuxt/test-utils' describe('fixtures:basic', async () => { await setup({ rootDir: fileURLToPath(new URL('./fixtures/basic', import.meta.url)), server: true }) it('server api', async () => { expect(await $fetch('/api/hello')).toBe('Hello API') expect(await $fetch('/api/hey')).toEqual({ foo: 'bar', baz: 'qux' }) }) it('render index.html', async () => { const index = await $fetch('/') // Snapshot // expect(index).toMatchInlineSnapshot() // should render text expect(index).toContain('Hello Nuxt 3!') // should render
components expect(index).toContain('