File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -63,17 +63,17 @@ if (!isBuild) {
6363 '<div id="hmr-test">foo</div>\n<!-- HMR-TEMPLATE-INJECT -->'
6464 )
6565 ) ;
66- expect ( await getText ( `#hmr-test` ) ) . toBe ( ' foo') ;
66+ await untilMatches ( ( ) => getText ( `#hmr-test` ) , 'foo' , '#hmr-test contains text foo') ;
6767 } ) ;
6868 test ( 'should apply style update' , async ( ) => {
6969 expect ( await getColor ( `h1` ) ) . toBe ( 'green' ) ;
7070 await updateApp ( ( content ) => content . replace ( 'color: green' , 'color: red' ) ) ;
71- expect ( await getColor ( `h1` ) ) . toBe ( ' red') ;
71+ await untilMatches ( ( ) => getColor ( 'h1' ) , 'red' , 'h1 has color red') ;
7272 } ) ;
7373 test ( 'should not preserve state of updated props' , async ( ) => {
7474 expect ( await getText ( `#foo` ) ) . toBe ( 'foo' ) ;
7575 await updateApp ( ( content ) => content . replace ( "foo = 'foo'" , "foo = 'bar'" ) ) ;
76- expect ( await getText ( `#foo` ) ) . toBe ( ' bar') ;
76+ await untilMatches ( ( ) => getText ( `#foo` ) , 'bar' , '#foo contains text bar') ;
7777 } ) ;
7878 } ) ;
7979}
Original file line number Diff line number Diff line change @@ -59,17 +59,17 @@ if (!isBuild) {
5959 '<div id="hmr-test">foo</div>\n<!-- HMR-TEMPLATE-INJECT -->'
6060 )
6161 ) ;
62- expect ( await getText ( `#hmr-test` ) ) . toBe ( ' foo') ;
62+ await untilMatches ( ( ) => getText ( `#hmr-test` ) , 'foo' , '#hmr-test contains text foo') ;
6363 } ) ;
6464 test ( 'should apply style update' , async ( ) => {
6565 expect ( await getColor ( `h1` ) ) . toBe ( 'green' ) ;
6666 await updateApp ( ( content ) => content . replace ( 'color: green' , 'color: red' ) ) ;
67- expect ( await getColor ( `h1` ) ) . toBe ( ' red') ;
67+ await untilMatches ( ( ) => getColor ( 'h1' ) , 'red' , 'h1 has color red') ;
6868 } ) ;
6969 test ( 'should not preserve state of updated props' , async ( ) => {
7070 expect ( await getText ( `#foo` ) ) . toBe ( 'foo' ) ;
7171 await updateApp ( ( content ) => content . replace ( "foo = 'foo'" , "foo = 'bar'" ) ) ;
72- expect ( await getText ( `#foo` ) ) . toBe ( ' bar') ;
72+ await untilMatches ( ( ) => getText ( `#foo` ) , 'bar' , '#foo contains text bar') ;
7373 } ) ;
7474 } ) ;
7575}
You can’t perform that action at this time.
0 commit comments