mirror of
https://github.com/microsoft/playwright.git
synced 2024-12-14 21:53:35 +03:00
fix(testrunner): fit.fail should run the test (#1407)
This commit is contained in:
parent
aa32d351be
commit
3960b179a1
@ -207,7 +207,7 @@ class TestWorker {
|
||||
return;
|
||||
}
|
||||
|
||||
if (test.expectation === TestExpectation.Fail) {
|
||||
if (test.expectation === TestExpectation.Fail && test.declaredMode !== TestMode.Focus) {
|
||||
await this._testPass._willStartTest(this, test);
|
||||
test.result = TestResult.MarkedAsFailing;
|
||||
await this._testPass._didFinishTest(this, test);
|
||||
|
@ -49,6 +49,15 @@ module.exports.addTests = function({testRunner, expect}) {
|
||||
expect(test.fullName).toBe('uno');
|
||||
expect(test.declaredMode).toBe('focus');
|
||||
});
|
||||
it('should run a failed focused test', async() => {
|
||||
const t = newTestRunner();
|
||||
let run = false;
|
||||
t.fit.fail(true)('uno', () => { run = true; throw new Error('failure'); });
|
||||
expect(t.tests().length).toBe(1);
|
||||
await t.run();
|
||||
expect(run).toBe(true);
|
||||
expect(t.failedTests()[0].name).toBe('uno');
|
||||
});
|
||||
});
|
||||
|
||||
describe('TestRunner.describe', () => {
|
||||
|
Loading…
Reference in New Issue
Block a user