@@ -76,12 +76,10 @@ describe("analyze", () => {
7676
7777 it ( "handles json" , async ( ) => {
7878 await expect ( ctx . runEask ( "analyze --json" ) ) . rejects . toThrow ( ) ;
79- await expect ( ctx . runEask ( "analyze Eask --json" ) ) . rejects . toThrow (
80- expect . objectContaining ( {
81- code : 1 ,
82- stderr : expect . stringContaining ( "(Checked 1 file)" ) ,
83- } ) ,
84- ) ;
79+ await expect ( ctx . runEask ( "analyze Eask --json" ) ) . rejects . toMatchObject ( {
80+ code : 1 ,
81+ stderr : expect . stringContaining ( "(Checked 1 file)" ) ,
82+ } ) ;
8583 } ) ;
8684 } ) ;
8785
@@ -128,19 +126,19 @@ describe("analyze", () => {
128126 ) . rejects . toThrow ( ) ;
129127 } ) ;
130128
131- // TODO prints 0 for some reason
132- it . failing ( "should print Checked when there are errors" , async ( ) => {
129+ it ( "should print Checked when there are errors" , async ( ) => {
133130 await expect ( ctx . runEask ( "analyze Eask-error" ) ) . rejects . toMatchObject ( {
134- stderr : "(Checked 1 file)" ,
131+ stderr : expect . stringContaining ( "(Checked 1 file)" ) ,
135132 } ) ;
136133 } ) ;
137134
138- // TODO prints 1 for some reason
139- it . failing ( "should check all files when --allow-error is set" , async ( ) => {
135+ it ( "should check all files when --allow-error is set" , async ( ) => {
140136 // this is not a great test because when there is any error it doesn't print this note
141137 await expect (
142138 ctx . runEask ( "analyze --allow-error Eask-normal Eask-error" ) ,
143- ) . rejects . toMatchObject ( { stderr : "(Checked 2 files)" } ) ;
139+ ) . rejects . toMatchObject ( {
140+ stderr : expect . stringContaining ( "(Checked 2 files)" ) ,
141+ } ) ;
144142 } ) ;
145143
146144 // although the output does match, it still doesn't exit with an error
0 commit comments