Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test: bad before good
  • Loading branch information
hi-ogawa committed Apr 10, 2024
commit 6cbf961c83bf6a05f3ba99963393527993305575
20 changes: 10 additions & 10 deletions playground/html/__tests__/html.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ describe('link with props', () => {
})
})

describe.runIf(isServe)('invalid', () => {
describe.runIf(isServe).only('invalid', () => {
test('should be 500 with overlay', async () => {
const response = await page.goto(viteTestUrl + '/invalid.html')
expect(response.status()).toBe(500)
Expand Down Expand Up @@ -274,15 +274,6 @@ describe.runIf(isServe)('invalid', () => {
expect(isVisbleOverlay).toBeFalsy()
})

test('should reload when fixed', async () => {
await page.goto(viteTestUrl + '/invalid.html')
await editFile('invalid.html', (content) => {
return content.replace('<div Bad', '<div> Good')
})
const content = await page.waitForSelector('text=Good HTML')
expect(content).toBeTruthy()
})

test('stack', async () => {
await page.goto(viteTestUrl + '/invalid.html')

Expand All @@ -305,6 +296,15 @@ describe.runIf(isServe)('invalid', () => {
const stack = await newErrorOverlay.$$eval('.stack', (m) => m[0].innerHTML)
expect(stack).toMatch(/^Error: someError/)
})

test('should reload when fixed', async () => {
await page.goto(viteTestUrl + '/invalid.html')
await editFile('invalid.html', (content) => {
return content.replace('<div Bad', '<div> Good')
})
const content = await page.waitForSelector('text=Good HTML')
expect(content).toBeTruthy()
})
})

describe('Valid HTML', () => {
Expand Down