Skip to content

Commit b2b9276

Browse files
committed
test(rsc): fix ssr modulepreload link test
1 parent b598bb5 commit b2b9276

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/plugin-rsc/e2e/react-router.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import path from 'node:path'
33
import { expect, test } from '@playwright/test'
44
import { type Fixture, useFixture } from './fixture'
55
import { expectNoReload, testNoJs, waitForHydration } from './helper'
6+
import { readFileSync } from 'node:fs'
67

78
test.describe('dev-default', () => {
89
const f = useFixture({ root: 'examples/react-router', mode: 'dev' })
@@ -74,8 +75,11 @@ function defineTest(f: Fixture) {
7475
.evaluateAll((elements) =>
7576
elements.map((el) => el.getAttribute('href')),
7677
)
77-
const { default: manifest } = await import(
78-
path.resolve(f.root, 'dist/ssr/__vite_rsc_assets_manifest.js')
78+
const manifest = JSON.parse(
79+
readFileSync(
80+
f.root + '/dist/ssr/__vite_rsc_assets_manifest.js',
81+
'utf-8',
82+
).slice('export default '.length),
7983
)
8084
const hashString = (v: string) =>
8185
createHash('sha256').update(v).digest().toString('hex').slice(0, 12)

0 commit comments

Comments
 (0)