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 {
2222 }
2323
2424 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' ) {
3235 return testMap ;
33- } , { } ) ;
36+ }
37+
38+ testMap [ test . fullName ] = true ;
39+ return testMap ;
40+ } , { } ) ;
3441 return suiteMap ;
35- } , { } ) ;
42+ } ,
43+ { } ,
44+ ) ;
3645
3746 this . _enabledTestsMap = Object . freeze ( this . _enabledTestsMap ) ;
3847 }
You can’t perform that action at this time.
0 commit comments