66 */
77
88import formatTestResults from '../formatTestResults' ;
9- import type { AggregatedResult } from '../types' ;
9+ import type { AggregatedResult , AssertionResult } from '../types' ;
1010
1111describe ( 'formatTestResults' , ( ) => {
1212 const assertion = {
1313 fullName : 'TestedModule#aMethod when some condition is met returns true' ,
1414 status : 'passed' ,
1515 title : 'returns true' ,
16- } ;
16+ } as AssertionResult ;
1717
18- const results : AggregatedResult = {
18+ const results = {
1919 testResults : [
2020 {
2121 numFailingTests : 0 ,
2222 perfStats : { end : 2 , runtime : 1 , slow : false , start : 1 } ,
23- // @ts -expect-error
2423 testResults : [ assertion ] ,
2524 } ,
2625 ] ,
27- } ;
26+ } as AggregatedResult ;
2827
2928 it ( 'includes test full name' , ( ) => {
3029 const result = formatTestResults ( results , undefined , null ) ;
@@ -37,21 +36,20 @@ describe('formatTestResults', () => {
3736 fullName : 'Pending test' ,
3837 status : 'pending' ,
3938 title : 'is still pending' ,
40- } ;
39+ } as AssertionResult ;
4140
42- const skippedResults : AggregatedResult = {
41+ const skippedResults = {
4342 testResults : [
4443 {
4544 numFailingTests : 0 ,
4645 numPassingTests : 0 ,
4746 numPendingTests : 2 ,
4847 numTodoTests : 2 ,
4948 perfStats : { end : 2 , runtime : 1 , slow : false , start : 1 } ,
50- // @ts -expect-error
5149 testResults : [ skippedAssertion ] ,
5250 } ,
5351 ] ,
54- } ;
52+ } as AggregatedResult ;
5553
5654 it ( 'should mark result status to skipped' , ( ) => {
5755 const result = formatTestResults ( skippedResults , undefined , null ) ;
@@ -64,21 +62,20 @@ describe('formatTestResults', () => {
6462 fullName : 'Focused test' ,
6563 status : 'focused' ,
6664 title : 'focused test' ,
67- } ;
65+ } as AssertionResult ;
6866
69- const focusedResults : AggregatedResult = {
67+ const focusedResults = {
7068 testResults : [
7169 {
7270 numFailingTests : 0 ,
7371 numPassingTests : 1 ,
7472 numPendingTests : 1 ,
7573 numTodoTests : 2 ,
7674 perfStats : { end : 2 , runtime : 1 , slow : false , start : 1 } ,
77- // @ts -expect-error
7875 testResults : [ focusedAssertion ] ,
7976 } ,
8077 ] ,
81- } ;
78+ } as AggregatedResult ;
8279
8380 it ( 'should mark result status to focused' , ( ) => {
8481 const result = formatTestResults ( focusedResults , undefined , null ) ;
0 commit comments