@@ -3,13 +3,12 @@ import assert from 'node:assert/strict';
33import fs from 'node:fs' ;
44import path from 'node:path' ;
55import vm from 'node:vm' ;
6- import { runReactProfileCommand } from './react-profile-command.ts' ;
76import { InspectorSession } from './metro-inspector.ts' ;
87import { commandHarness , TARGET } from './react-devtools-command.fixtures.ts' ;
98import { FakeAppRuntime , MEMO_TYPE , encodeOperations } from './react-devtools-runtime.fixtures.ts' ;
109
1110const harness = ( app ?: FakeAppRuntime , targets ?: unknown [ ] ) =>
12- commandHarness ( runReactProfileCommand , app , targets ) ;
11+ commandHarness ( [ 'profile' ] , app , targets ) ;
1312
1413afterEach ( ( ) => {
1514 vi . restoreAllMocks ( ) ;
@@ -261,13 +260,16 @@ test('drill-down views read the saved recording, not a trimmed analysis', async
261260 assert . equal ( saved . version , 2 ) ;
262261 assert . equal ( saved . profile . commits . length , 3 ) ;
263262 assert . match ( ( await run ( 'report' , 'Row' ) ) . text , / c h a n g e d p r o p s : o n P r e s s 3 6 \( f u n c t i o n \) / ) ;
263+ assert . doesNotMatch ( ( await run ( 'report' , 'Row' ) ) . text , / c o l l e c t i o n m a y h a v e b e e n i n t e r r u p t e d / ) ;
264264} ) ;
265265
266266test ( 'stop saves the raw recording before optional prop inspection' , async ( ) => {
267267 const { app, run, stateDir } = harness ( ) ;
268268 await run ( 'start' ) ;
269269 recordRowRenders ( app ) ;
270- let checkpoint : { profile : { commits : unknown [ ] } ; propKinds : unknown } | undefined ;
270+ let checkpoint :
271+ | { profile : { commits : unknown [ ] } ; propKinds : unknown ; notes : string [ ] }
272+ | undefined ;
271273 vi . mocked ( InspectorSession . connect ) . mockResolvedValue ( {
272274 evaluate : async ( expression : string ) => {
273275 if ( expression . includes ( '.describeProps(' ) ) {
@@ -282,6 +284,9 @@ test('stop saves the raw recording before optional prop inspection', async () =>
282284 const stopped = await run ( 'stop' ) ;
283285 assert . equal ( checkpoint ?. profile . commits . length , 3 ) ;
284286 assert . deepEqual ( checkpoint ?. propKinds , { } ) ;
287+ assert . deepEqual ( checkpoint ?. notes , [
288+ 'Changed prop values have not been inspected; collection may have been interrupted.' ,
289+ ] ) ;
285290 assert . match ( stopped . text , / C h a n g e d p r o p v a l u e s c o u l d n o t b e i n s p e c t e d : i n s p e c t i o n u n a v a i l a b l e / ) ;
286291 assert . match ( ( await run ( 'report' , 'Row' ) ) . text , / r e n d e r s 3 6 / ) ;
287292} ) ;
0 commit comments