From 6b07b2287b2bea98fbfdba1a0611952183393827 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Fri, 23 Aug 2024 14:51:23 +0200 Subject: [PATCH] add test --- tests/playwright-test/expect-poll.spec.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/playwright-test/expect-poll.spec.ts b/tests/playwright-test/expect-poll.spec.ts index fb7f63e846..aa8bbde79d 100644 --- a/tests/playwright-test/expect-poll.spec.ts +++ b/tests/playwright-test/expect-poll.spec.ts @@ -243,5 +243,18 @@ test('should propagate promise rejections', { annotation: { type: 'issue', descr ` }); + expect(result.output).toContain('some error'); +}); + +test('should propagate string exception from async arrow function', { annotation: { type: 'issue', description: 'https://github.com/microsoft/playwright/issues/32256' } }, async ({ runInlineTest }) => { + const result = await runInlineTest({ + 'a.spec.ts': ` + import { test, expect } from '@playwright/test'; + test('should fail', async () => { + await expect.poll(async () => { throw 'some error' }).toBe({ foo: 'baz' }); + }); + ` + }); + expect(result.output).toContain('some error'); }); \ No newline at end of file