Skip to content

Commit f764d7c

Browse files
committed
test: verify
1 parent 4ef112b commit f764d7c

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

packages/plugin-rsc/e2e/basic.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@ import { createHash } from 'node:crypto'
22
import { readFileSync } from 'node:fs'
33
import { type Page, expect, test } from '@playwright/test'
44
import { type Fixture, setupIsolatedFixture, useFixture } from './fixture'
5-
import { expectNoReload, testNoJs, waitForHydration } from './helper'
5+
import {
6+
expectNoPageError,
7+
expectNoReload,
8+
testNoJs,
9+
waitForHydration,
10+
} from './helper'
611
import path from 'node:path'
712
import os from 'node:os'
813

@@ -73,6 +78,7 @@ test.describe(() => {
7378

7479
function defineTest(f: Fixture) {
7580
test('basic', async ({ page }) => {
81+
using _ = expectNoPageError(page)
7682
await page.goto(f.url())
7783
await waitForHydration(page)
7884
})

packages/plugin-rsc/e2e/starter.test.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { expect, test } from '@playwright/test'
22
import { setupInlineFixture, type Fixture, useFixture } from './fixture'
33
import {
4+
expectNoPageError,
45
expectNoReload,
56
testNoJs,
67
waitForHydration as waitForHydration_,
@@ -51,6 +52,13 @@ test.describe('dev-production', () => {
5152
},
5253
})
5354
defineTest(f, 'dev-production')
55+
56+
test('verify production', async ({ page }) => {
57+
await page.goto(f.url())
58+
await waitForHydration_(page)
59+
const res = await page.request.get(f.url('src/client.tsx'))
60+
expect(await res.text()).not.toContain('jsxDev')
61+
})
5462
})
5563

5664
test.describe('build-development', () => {
@@ -62,6 +70,10 @@ test.describe('build-development', () => {
6270
},
6371
})
6472
defineTest(f)
73+
74+
test('verify development', async () => {
75+
// TODO
76+
})
6577
})
6678

6779
test.describe(() => {
@@ -230,6 +242,7 @@ function defineTest(f: Fixture, variant?: 'no-ssr' | 'dev-production') {
230242
waitForHydration_(page, variant === 'no-ssr' ? '#root' : 'body')
231243

232244
test('basic', async ({ page }) => {
245+
using _ = expectNoPageError(page)
233246
await page.goto(f.url())
234247
await waitForHydration(page)
235248
})

0 commit comments

Comments
 (0)