[READ-ONLY] Mirror of https://github.com/danielroe/roe.dev. This is the code and content for my personal website, built in Nuxt.
roe.dev
1/** @vitest-environment node */
2import { fileURLToPath } from 'node:url'
3
4import { describe, expect, it } from 'vitest'
5import { createPage, setup } from '@nuxt/test-utils'
6
7await setup({
8 rootDir: fileURLToPath(new URL('../..', import.meta.url)),
9 nuxtConfig: {
10 nitro: {
11 prerender: {
12 crawlLinks: false,
13 },
14 },
15 hooks: {
16 'prerender:routes'(routes) {
17 routes.routes.clear()
18 routes.routes.add('/')
19 },
20 },
21 },
22})
23
24describe('site behaviour', () => {
25 it('renders server components', async () => {
26 const page = await createPage('/')
27 await page.waitForLoadState('networkidle')
28 expect(await page.getByText('2019-2023').innerHTML()).toMatchInlineSnapshot(
29 '" © 2019-2023 Daniel Roe. <a class=\\"link\\" href=\\"https://creativecommons.org/licenses/by-nc-sa/4.0/\\"> CC BY-SA 4.0 </a>"'
30 )
31 })
32})