From 3a31128827806a27df368fbc5fe8cccae4bb507f Mon Sep 17 00:00:00 2001 From: Adam Gastineau Date: Tue, 18 Feb 2025 11:27:23 -0800 Subject: [PATCH] Add Promise prototype test --- tests/playwright-test/warnings.spec.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) 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); + }); });