test: add regressions fail.only test

This commit is contained in:
pengoosedev 2024-10-06 00:51:13 +09:00
parent 890b562803
commit c5496a7a2e

View file

@ -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);
});
`
});
});