@@ -11,13 +11,13 @@ import { assertableSymbol } from "../assertable.js";
1111
1212export const toRerender : MatcherFunction < [ options ?: NextRenderOptions ] > =
1313 async function ( actual , options ) {
14- const _profiler = actual as RenderStream < any > | Assertable ;
15- const profiler =
16- assertableSymbol in _profiler ? _profiler [ assertableSymbol ] : _profiler ;
14+ const _stream = actual as RenderStream < any > | Assertable ;
15+ const stream =
16+ assertableSymbol in _stream ? _stream [ assertableSymbol ] : _stream ;
1717 const hint = this . utils . matcherHint ( "toRerender" , "ProfiledComponent" , "" ) ;
1818 let pass = true ;
1919 try {
20- await profiler . peekRender ( { timeout : 100 , ...options } ) ;
20+ await stream . peekRender ( { timeout : 100 , ...options } ) ;
2121 } catch ( e ) {
2222 if ( e instanceof WaitForRenderTimeoutError ) {
2323 pass = false ;
@@ -44,26 +44,26 @@ const failed = {};
4444export const toRenderExactlyTimes : MatcherFunction <
4545 [ times : number , options ?: NextRenderOptions ]
4646> = async function ( actual , times , optionsPerRender ) {
47- const _profiler = actual as RenderStream < any > | Assertable ;
48- const profiler =
49- assertableSymbol in _profiler ? _profiler [ assertableSymbol ] : _profiler ;
47+ const _stream = actual as RenderStream < any > | Assertable ;
48+ const stream =
49+ assertableSymbol in _stream ? _stream [ assertableSymbol ] : _stream ;
5050 const options = { timeout : 100 , ...optionsPerRender } ;
5151 const hint = this . utils . matcherHint ( "toRenderExactlyTimes" ) ;
5252 let pass = true ;
5353 try {
54- if ( profiler . totalRenderCount ( ) > times ) {
54+ if ( stream . totalRenderCount ( ) > times ) {
5555 throw failed ;
5656 }
5757 try {
58- while ( profiler . totalRenderCount ( ) < times ) {
59- await profiler . waitForNextRender ( options ) ;
58+ while ( stream . totalRenderCount ( ) < times ) {
59+ await stream . waitForNextRender ( options ) ;
6060 }
6161 } catch ( e ) {
6262 // timeouts here should just fail the test, rethrow other errors
6363 throw e instanceof WaitForRenderTimeoutError ? failed : e ;
6464 }
6565 try {
66- await profiler . waitForNextRender ( options ) ;
66+ await stream . waitForNextRender ( options ) ;
6767 } catch ( e ) {
6868 // we are expecting a timeout here, so swallow that error, rethrow others
6969 if ( ! ( e instanceof WaitForRenderTimeoutError ) ) {
@@ -83,7 +83,7 @@ export const toRenderExactlyTimes: MatcherFunction<
8383 return (
8484 hint +
8585 ` Expected component to${ pass ? " not" : "" } render exactly ${ times } .` +
86- ` It rendered ${ profiler . totalRenderCount ( ) } times.`
86+ ` It rendered ${ stream . totalRenderCount ( ) } times.`
8787 ) ;
8888 } ,
8989 } ;
0 commit comments