File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11const { resolve} = require ( 'path' )
22const { render} = require ( '../pure' )
3+ const { waitFor} = require ( "../wait-for" ) ;
34
45test ( 'findByText should find text' , async ( ) => {
56 const { findByText} = await render ( 'node' , [
@@ -43,7 +44,7 @@ test('getByText should find text', async () => {
4344 '--version' ,
4445 ] )
4546
46- expect ( getByText ( '--version' ) ) . toBeTruthy ( ) ;
47+ expect ( await waitFor ( ( ) => getByText ( '--version' ) ) ) . toBeTruthy ( ) ;
4748} )
4849
4950test ( 'getByText should throw errors' , async ( ) => {
@@ -52,5 +53,5 @@ test('getByText should throw errors', async () => {
5253 '--version' ,
5354 ] )
5455
55- expect ( ( ) => getByText ( '--nothing' ) ) . toThrow ( 'Unable to find an stdout line with the text:' ) ;
56+ await expect ( ( ) => waitFor ( ( ) => getByText ( '--nothing' ) ) ) . rejects . toThrow ( 'Unable to find an stdout line with the text:' ) ;
5657} )
You can’t perform that action at this time.
0 commit comments