@@ -21,6 +21,24 @@ test('toBeInTheConsole should fail when something is not console', async () => {
2121 expect ( ( ) => expect ( queryByText ( 'NotHere' ) ) . toBeInTheConsole ( ) ) . toThrow ( / v a l u e m u s t b e a T e s t I n s t a n c e / )
2222} )
2323
24+ test ( 'not.toBeInTheConsole should pass something is not console' , async ( ) => {
25+ const { queryByText} = await render ( 'node' , [
26+ resolve ( __dirname , './execute-scripts/list-args.js' ) ,
27+ '--version' ,
28+ ] )
29+
30+ expect ( ( ) => expect ( queryByText ( 'NotHere' ) ) . not . toBeInTheConsole ( ) ) . not . toThrow ( )
31+ } )
32+
33+ test ( 'not.toBeInTheConsole should fail something is console' , async ( ) => {
34+ const { queryByText} = await render ( 'node' , [
35+ resolve ( __dirname , './execute-scripts/list-args.js' ) ,
36+ '--version' ,
37+ ] )
38+
39+ expect ( ( ) => expect ( queryByText ( '--version' ) ) . not . toBeInTheConsole ( ) ) . toThrow ( / E x p e c t e d n o t t o f i n d t h e i n s t a n c e i n t h e c o n s o l e / )
40+ } )
41+
2442test ( 'toHaveErrorMessage should pass during stderr when no string passed' , async ( ) => {
2543 const instance = await render ( 'node' , [
2644 resolve ( __dirname , './execute-scripts/throw.js' ) ,
@@ -48,7 +66,7 @@ test('toHaveErrorMessage should fail when something is not in stderr', async ()
4866 ] )
4967
5068 const instance = await findByText ( '--version' )
51- expect ( ( ) => expect ( instance ) . toHaveErrorMessage ( "Error isn't here" ) ) . toThrow ( / E x p e c t e d t h e e l e m e n t t o h a v e e r r o r m e s s a g e / )
69+ expect ( ( ) => expect ( instance ) . toHaveErrorMessage ( "Error isn't here" ) ) . toThrow ( / E x p e c t e d t h e i n s t a n c e t o h a v e e r r o r m e s s a g e / )
5270} )
5371
5472test ( 'toHaveErrorMessage should fail when null is passed' , async ( ) => {
0 commit comments