Skip to content

Commit 2125eb6

Browse files
fix tests
1 parent 6ae0893 commit 2125eb6

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

packages/start-plugin-core/src/prerender.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ export async function prerender({
212212
: cleanPagePath
213213

214214
const isSpaShell =
215-
startConfig.spa?.prerender?.outputPath === cleanPagePath
215+
startConfig.spa?.prerender.outputPath === cleanPagePath
216216

217217
let htmlPath: string
218218
if (isSpaShell) {

packages/start-plugin-core/tests/post-server-build.test.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import { describe, expect, it, vi } from 'vitest'
2-
import { postServerBuild } from '../src/post-server-build'
32
import { VITE_ENVIRONMENT_NAMES } from '../src/constants'
43

4+
vi.mock('@tanstack/start-server-core', () => ({
5+
HEADERS: {
6+
TSS_SHELL: 'x-tss-shell',
7+
},
8+
}))
9+
510
vi.mock('../src/prerender', () => ({
611
prerender: vi.fn(async () => {}),
712
}))
@@ -26,6 +31,9 @@ describe('postServerBuild', () => {
2631
} as any
2732

2833
it('rejects absolute SPA maskPath URLs to avoid external prerendering', async () => {
34+
// Import after mocks are set up
35+
const { postServerBuild } = await import('../src/post-server-build')
36+
2937
const startConfig = {
3038
spa: {
3139
enabled: true,

0 commit comments

Comments
 (0)