Add Promise prototype test

This commit is contained in:
Adam Gastineau 2025-02-18 11:27:23 -08:00
parent 9f216ec420
commit 3a31128827

View file

@ -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,<div>A</div>');
const expectPromise = expect(page.locator('div')).toHaveText('A');
expect(expectPromise instanceof Promise).toBeTruthy();
});
`
});
expect(exitCode).toBe(0);
});
});