Skip to content

Commit 60a19e6

Browse files
committed
Replace test result with util
1 parent cc09d52 commit 60a19e6

1 file changed

Lines changed: 6 additions & 18 deletions

File tree

e2e/transform/transform-runner/runner.ts

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import {
1515
TestWatcher,
1616
} from 'jest-runner';
1717
import throat from 'throat';
18-
import {TestResult} from '@jest/test-result';
18+
import {TestResult, createEmptyTestResult} from '@jest/test-result';
1919

2020
export default class BaseTestRunner {
2121
private _globalConfig: Config.GlobalConfig;
@@ -38,37 +38,25 @@ export default class BaseTestRunner {
3838
(promise, test) =>
3939
mutex(() =>
4040
promise
41-
.then(async () => {
41+
.then(async () : Promise<TestResult> => {
4242
await onStart(test);
4343
return {
44-
numFailingTests: 0,
44+
...createEmptyTestResult(),
4545
numPassingTests: 1,
46-
numPendingTests: 0,
47-
numTodoTests: 0,
48-
perfStats: {
49-
end: 0,
50-
start: 0,
51-
},
52-
snapshot: {
53-
added: 0,
54-
fileDeleted: false,
55-
matched: 0,
56-
unchecked: 0,
57-
unmatched: 0,
58-
updated: 0,
59-
},
6046
testFilePath: test.path,
6147
testResults: [
6248
{
6349
ancestorTitles: [],
6450
duration: 2,
6551
failureMessages: [],
6652
fullName: 'sample test',
53+
location: null,
54+
numPassingAsserts: 1,
6755
status: 'passed',
6856
title: 'sample test',
6957
},
7058
],
71-
} as TestResult;
59+
};
7260
})
7361
.then(result => onResult(test, result))
7462
.catch(err => onFailure(test, err))

0 commit comments

Comments
 (0)