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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (test.expectation === TestExpectation.Fail) {
|
if (test.expectation === TestExpectation.Fail && test.declaredMode !== TestMode.Focus) {
|
||||||
await this._testPass._willStartTest(this, test);
|
await this._testPass._willStartTest(this, test);
|
||||||
test.result = TestResult.MarkedAsFailing;
|
test.result = TestResult.MarkedAsFailing;
|
||||||
await this._testPass._didFinishTest(this, test);
|
await this._testPass._didFinishTest(this, test);
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,15 @@ module.exports.addTests = function({testRunner, expect}) {
|
||||||
expect(test.fullName).toBe('uno');
|
expect(test.fullName).toBe('uno');
|
||||||
expect(test.declaredMode).toBe('focus');
|
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', () => {
|
describe('TestRunner.describe', () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue