Skip to content

Commit 4770ece

Browse files
committed
update test
1 parent cc4072d commit 4770ece

1 file changed

Lines changed: 9 additions & 6 deletions

File tree

examples/full/.testRun.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,21 +63,21 @@ function testRun(cmd: `pnpm run ${'dev' | 'preview'}`) {
6363
body = await page.textContent('body')
6464
expect(body).toContain(t1)
6565
expect(body).not.toContain(t2)
66-
ensureWasClientSideRouted('/pages/without-ssr')
66+
await ensureWasClientSideRouted('/pages/without-ssr')
6767

6868
await page.click('a:has-text("Welcome")')
6969
await testCounter()
7070
body = await page.textContent('body')
7171
expect(body).toContain(t2)
7272
expect(body).not.toContain(t1)
73-
ensureWasClientSideRouted('/pages/without-ssr')
73+
await ensureWasClientSideRouted('/pages/without-ssr')
7474

7575
await page.click('a:has-text("Without SSR")')
7676
await testCounter()
7777
body = await page.textContent('body')
7878
expect(body).toContain(t1)
7979
expect(body).not.toContain(t2)
80-
ensureWasClientSideRouted('/pages/without-ssr')
80+
await ensureWasClientSideRouted('/pages/without-ssr')
8181
})
8282
}
8383

@@ -166,10 +166,10 @@ function testUseConfig() {
166166
await page.goto(getServerUrl() + '/')
167167
expect(await page.title()).toBe('My Vike + Vue App')
168168
await testCounter()
169-
ensureWasClientSideRouted('/pages/index')
169+
await ensureWasClientSideRouted('/pages/index')
170170
await page.click('a:has-text("useConfig()")')
171171
await testCounter()
172-
ensureWasClientSideRouted('/pages/index')
172+
await ensureWasClientSideRouted('/pages/index')
173173
await page.goto(getServerUrl() + '/images')
174174
expect(await page.title()).toBe('Image created by Romuald Brillout')
175175
await testCounter()
@@ -251,8 +251,11 @@ function findFirstPageId(html: string) {
251251
expect(html.split('"pageId"').length).toBe(2)
252252
const match = partRegex`"pageId":"${/([^"]+)/}"`.exec(html)
253253
expect(match).toBeTruthy()
254-
const pageId = match![1]
254+
let pageId = match![1]
255255
expect(pageId).toBeTruthy()
256+
pageId =
257+
// @ts-ignore
258+
pageId.replaceAll('\\\\/', '/')
256259
return pageId
257260
}
258261

0 commit comments

Comments
 (0)