Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/sxzz/hanji. 一字之間,照見五地字形 hanji.sxzz.moe
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031import { readFileSync } from 'node:fs'import { describe, expect, it } from 'vitest'import config from '../../nuxt.config.ts'import type { CharsData } from '../../shared/types.ts'
const chars: CharsData = JSON.parse( readFileSync( new URL('../../app/assets/data/chars.json', import.meta.url), 'utf8', ),)
describe('character page prerendering', () => { it('includes every canonical character route', () => { const routes = new Set(config.nitro.prerender.routes) const expected = chars.rows.map( (row) => `/char/${encodeURIComponent(row.key)}`, )
expect(expected.filter((route) => !routes.has(route))).toEqual([]) expect( [...routes].filter((route) => route.startsWith('/char/')), ).toHaveLength(chars.rows.length) expect(config.nitro.prerender.autoSubfolderIndex).toBe(false) })
it('opts out of a network favicon request', () => { expect(config.app.head.link).toContainEqual({ rel: 'icon', href: 'data:,' }) })})