Skip to content

Commit

Permalink
test: ensure routes are prerendered
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Nov 15, 2023
1 parent f856ecc commit f23d548
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
20 changes: 12 additions & 8 deletions test/csr/generate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,20 @@ import { describe, it, expect } from 'vitest'

const fixture = fileURLToPath(new URL('../../playground', import.meta.url))

describe('ssr: false, target: static, generated files', async () => {
await setup({
fixture,
server: false,
nuxtConfig: {
_generate: true,
ssr: false
await setup({
rootDir: fixture,
server: false,
nuxtConfig: {
ssr: false,
nitro: {
prerender: {
routes: ['/', '/200.html']
}
}
})
}
})

describe('ssr: false, target: static, generated files', () => {
it('generated file', async () => {
const ctx = useTestContext()
const generateDir = resolve(ctx.nuxt!.options.nitro.output?.dir || '', 'public')
Expand Down
18 changes: 11 additions & 7 deletions test/ssr/generate.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,19 @@ import { describe, it, expect } from 'vitest'

const fixture = fileURLToPath(new URL('../../playground', import.meta.url))

describe('ssr: true, target: static, generated files', async () => {
await setup({
server: false,
fixture,
nuxtConfig: {
_generate: true
await setup({
server: false,
rootDir: fixture,
nuxtConfig: {
nitro: {
prerender: {
routes: ['/', '/200.html']
}
}
})
}
})

describe('ssr: true, target: static, generated files', () => {
it('generated file', async () => {
const ctx = useTestContext()
const generateDir = resolve(ctx.nuxt!.options.nitro.output?.dir || '', 'public')
Expand Down

0 comments on commit f23d548

Please sign in to comment.