File tree Expand file tree Collapse file tree 1 file changed +18
-9
lines changed Expand file tree Collapse file tree 1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -22,17 +22,26 @@ export default class FailedTestsCache {
22
22
}
23
23
24
24
setTestResults ( testResults : Array < TestResult > ) : void {
25
- this . _enabledTestsMap = ( testResults || [ ] )
26
- . filter ( testResult => testResult . numFailingTests )
27
- . reduce < TestMap > ( ( suiteMap , testResult ) => {
28
- suiteMap [ testResult . testFilePath ] = testResult . testResults
29
- . filter ( test => test . status === 'failed' )
30
- . reduce < { [ name : string ] : true } > ( ( testMap , test ) => {
31
- testMap [ test . fullName ] = true ;
25
+ this . _enabledTestsMap = ( testResults || [ ] ) . reduce < TestMap > (
26
+ ( suiteMap , testResult ) => {
27
+ if ( ! testResult . numFailingTests ) {
28
+ return suiteMap ;
29
+ }
30
+
31
+ suiteMap [ testResult . testFilePath ] = testResult . testResults . reduce < {
32
+ [ name : string ] : true ;
33
+ } > ( ( testMap , test ) => {
34
+ if ( test . status !== 'failed' ) {
32
35
return testMap ;
33
- } , { } ) ;
36
+ }
37
+
38
+ testMap [ test . fullName ] = true ;
39
+ return testMap ;
40
+ } , { } ) ;
34
41
return suiteMap ;
35
- } , { } ) ;
42
+ } ,
43
+ { } ,
44
+ ) ;
36
45
37
46
this . _enabledTestsMap = Object . freeze ( this . _enabledTestsMap ) ;
38
47
}
You can’t perform that action at this time.
0 commit comments