Skip to content

Commit e2ad5e3

Browse files
committed
test: add browser
1 parent 3177a39 commit e2ad5e3

2 files changed

Lines changed: 16 additions & 1 deletion

File tree

test/browser/fixtures/failing/failing.test.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,15 @@ it('several locator methods are not awaited', () => {
3838
it('correctly prints error from a bundled file', () => {
3939
index()
4040
})
41+
42+
it('not awaited but with then/catch/finally', async () => {
43+
await page.getByRole('button').click().then()
44+
await page.getByRole('button').click().catch()
45+
await page.getByRole('button').click().finally()
46+
await userEvent.click(page.getByRole('button')).then()
47+
await userEvent.click(page.getByRole('button')).catch()
48+
await userEvent.click(page.getByRole('button')).finally()
49+
page.getByRole('button').click().then()
50+
page.getByRole('button').click().catch()
51+
page.getByRole('button').click().finally()
52+
})

test/browser/specs/runner.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ error with a stack
209209
})
210210

211211
test(`stack trace points to correct file in every browser when failed`, async () => {
212-
expect.assertions(29)
212+
expect.assertions(30)
213213
const { stderr } = await runBrowserTests({
214214
root: './fixtures/failing',
215215
reporters: [
@@ -273,6 +273,9 @@ test(`stack trace points to correct file in every browser when failed`, async ()
273273

274274
// index() is called from a bundled file
275275
expect(stderr).toMatch(/failing.test.ts:39:(2|8)/)
276+
277+
// "not awaited but with then/catch/finally" test should not produce warnings
278+
expect(stderr).not.toMatch(/failing.test.ts:4[3-8]/)
276279
})
277280

278281
test('user-event', async () => {

0 commit comments

Comments
 (0)