@@ -51,4 +51,42 @@ describe("analyze", () => {
5151 await ctx . runEask ( "analyze Eask --json" ) ;
5252 } ) ;
5353 } ) ;
54+
55+ describe ( "in ./analyze/errors" , ( ) => {
56+ const ctx = new TestContext ( "./test/jest/analyze/errors" ) ;
57+
58+ // Eask-normal - no errors or warnings
59+ // Eask-warn - only warnings
60+ // Eask-error - errors and warnings
61+
62+ it ( "should check Eask-normal" , async ( ) => {
63+ await ctx . runEask ( "analyze Eask-normal" ) ;
64+ } ) ;
65+
66+ it ( "should check Eask-warn" , async ( ) => {
67+ await ctx . runEask ( "analyze Eask-warn" ) ;
68+ } ) ;
69+
70+ it . failing ( "should error on Eask-errors" , async ( ) => {
71+ await expect ( ctx . runEask ( "analyze Eask-error" ) ) . rejects . toThrow ( ) ;
72+ } ) ;
73+
74+ it . failing ( "should error when using --strict on Eask-warn" , async ( ) => {
75+ await expect ( ctx . runEask ( "analyze --strict Eask-warn" ) ) . rejects . toThrow ( ) ;
76+ } ) ;
77+
78+ // sanity check: flag should not change behavior in this case
79+ // this is because the menaing of --allow-error is "continue to the end"
80+ it . failing ( "should error when --allow-error is set" , async ( ) => {
81+ await expect (
82+ ctx . runEask ( "analyze Eask-error --allow-error" ) ,
83+ ) . rejects . toThrow ( ) ;
84+ } ) ;
85+
86+ it . failing ( "should check all files when --allow-error is set" , async ( ) => {
87+ await expect (
88+ ctx . runEask ( "analyze --allow-error Eask-normal Eask-error" ) ,
89+ ) . rejects . toMatchObject ( { stderr : "(Checked 2 files)" } ) ;
90+ } ) ;
91+ } ) ;
5492} ) ;
0 commit comments