diff --git a/tests/playwright-test/warnings.spec.ts b/tests/playwright-test/warnings.spec.ts index db1152ee91..ce4796cfd6 100644 --- a/tests/playwright-test/warnings.spec.ts +++ b/tests/playwright-test/warnings.spec.ts @@ -158,4 +158,18 @@ test.describe('await', () => { expect(exitCode).toBe(0); expect(stdout).toContain(warningSnippet); }); + + test('traced promise should be instanceof Promise', async ({ runInlineTest }) => { + const { exitCode } = await runInlineTest({ + 'a.test.ts': ` + import { test, expect } from '@playwright/test'; + test('test', async ({ page }) => { + await page.setContent('data:text/html,
A
'); + const expectPromise = expect(page.locator('div')).toHaveText('A'); + expect(expectPromise instanceof Promise).toBeTruthy(); + }); + ` + }); + expect(exitCode).toBe(0); + }); });