@@ -3295,10 +3295,12 @@ describe('runDiff', () => {
32953295 expect ( errs . join ( '\n' ) ) . toContain ( 'different tests' ) ;
32963296 } ) ;
32973297
3298- it ( '--dry-run returns the canned sample fully offline (no credentials, no fetch)' , async ( ) => {
3299- // Dry-run must not require credentials or hit the network — it returns a
3300- // canned CliRunDiff so `--dry-run` shows the shape offline.
3301- const diff = await runDiff (
3298+ it ( '--dry-run prints the canned sample fully offline and exits 1 when verdicts differ' , async ( ) => {
3299+ // Dry-run must not require credentials or hit the network. It still emits a
3300+ // canned CliRunDiff so `--dry-run` shows the shape offline, then follows the
3301+ // same verdict-change exit contract as the real path.
3302+ const out : string [ ] = [ ] ;
3303+ const rejection = await runDiff (
33023304 {
33033305 profile : 'default' ,
33043306 output : 'json' ,
@@ -3307,8 +3309,15 @@ describe('runDiff', () => {
33073309 runA : 'run_aaa' ,
33083310 runB : 'run_bbb' ,
33093311 } ,
3310- { stdout : ( ) => undefined , stderr : ( ) => undefined } ,
3311- ) ;
3312+ { stdout : line => out . push ( line ) , stderr : ( ) => undefined } ,
3313+ ) . catch ( ( error : unknown ) => error ) ;
3314+ expect ( rejection ) . toMatchObject ( { exitCode : 1 } ) ;
3315+ const diff = JSON . parse ( out . join ( '' ) ) as {
3316+ runA : { runId : string } ;
3317+ runB : { runId : string } ;
3318+ verdictChanged : boolean ;
3319+ changedSteps : Array < { stepIndex : number ; statusA : string ; statusB : string } > ;
3320+ } ;
33123321 expect ( diff . runA . runId ) . toBe ( 'run_aaa' ) ;
33133322 expect ( diff . runB . runId ) . toBe ( 'run_bbb' ) ;
33143323 expect ( diff . verdictChanged ) . toBe ( true ) ;
0 commit comments