From c5496a7a2e66b46438e01aa1ad4e876b76e27725 Mon Sep 17 00:00:00 2001 From: pengoosedev <73521518+pengoosedev@users.noreply.github.com> Date: Sun, 6 Oct 2024 00:51:13 +0900 Subject: [PATCH] test: add regressions fail.only test --- tests/playwright-test/types-2.spec.ts | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/playwright-test/types-2.spec.ts b/tests/playwright-test/types-2.spec.ts index ed9df2c033..519c6e21aa 100644 --- a/tests/playwright-test/types-2.spec.ts +++ b/tests/playwright-test/types-2.spec.ts @@ -206,3 +206,25 @@ test('step should inherit return type from its callback ', async ({ runTSC }) => }); expect(result.exitCode).toBe(0); }); + +test('should only run the failing test', async ({ runTSC }) => { + const result = await runTSC({ + 'a.spec.ts': ` + import { test, expect } from '@playwright/test'; + test('should not run this test', async () => { + // This test should be skipped because of test.fail.only + expect(true).toBe(true); + }); + + test.fail.only('should only run this failing test', async () => { + // This test is expected to fail + expect(true).toBe(false); + }); + + test('should also not run this test', async () => { + // This test should be skipped because of test.fail.only + expect(true).toBe(true); + }); + ` + }); +}); \ No newline at end of file