File tree Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Expand file tree Collapse file tree 2 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -62,7 +62,7 @@ expectAssignable<Dispatcher>(new SnapshotAgent())
6262 expectType < Promise < void > > ( snapshotAgent . loadSnapshots ( ) )
6363 expectType < Promise < void > > ( snapshotAgent . loadSnapshots ( './custom.json' ) )
6464 expectType < SnapshotRecorder > ( snapshotAgent . getRecorder ( ) )
65- expectType < 'record' | 'playback' | 'update' > ( snapshotAgent . getMode ( ) )
65+ expectType < SnapshotRecorder . SnapshotRecorderMode > ( snapshotAgent . getMode ( ) )
6666 expectType < void > ( snapshotAgent . clearSnapshots ( ) )
6767
6868 // New snapshot management methods
@@ -361,9 +361,9 @@ expectAssignable<SnapshotAgent.Options>({
361361 const playbackAgent = new SnapshotAgent ( { mode : 'playback' , snapshotPath : './test.json' } )
362362 const updateAgent = new SnapshotAgent ( { mode : 'update' , snapshotPath : './test.json' } )
363363
364- expectType < 'record' | 'playback' | 'update' > ( recordAgent . getMode ( ) )
365- expectType < 'record' | 'playback' | 'update' > ( playbackAgent . getMode ( ) )
366- expectType < 'record' | 'playback' | 'update' > ( updateAgent . getMode ( ) )
364+ expectType < SnapshotRecorder . SnapshotRecorderMode > ( recordAgent . getMode ( ) )
365+ expectType < SnapshotRecorder . SnapshotRecorderMode > ( playbackAgent . getMode ( ) )
366+ expectType < SnapshotRecorder . SnapshotRecorderMode > ( updateAgent . getMode ( ) )
367367}
368368
369369{
Original file line number Diff line number Diff line change @@ -18,9 +18,11 @@ declare class SnapshotRecorder {
1818}
1919
2020declare namespace SnapshotRecorder {
21+ type SnapshotRecorderMode = 'record' | 'playback' | 'update'
22+
2123 export interface Options {
2224 snapshotPath ?: string
23- mode ?: 'record' | 'playback' | 'update'
25+ mode ?: SnapshotRecorderMode
2426 maxSnapshots ?: number
2527 autoFlush ?: boolean
2628 flushInterval ?: number
@@ -77,7 +79,7 @@ declare class SnapshotAgent extends MockAgent {
7779 saveSnapshots ( filePath ?: string ) : Promise < void >
7880 loadSnapshots ( filePath ?: string ) : Promise < void >
7981 getRecorder ( ) : SnapshotRecorder
80- getMode ( ) : 'record' | 'playback' | 'update'
82+ getMode ( ) : SnapshotRecorder . SnapshotRecorderMode
8183 clearSnapshots ( ) : void
8284 resetCallCounts ( ) : void
8385 deleteSnapshot ( requestOpts : any ) : boolean
@@ -87,7 +89,7 @@ declare class SnapshotAgent extends MockAgent {
8789
8890declare namespace SnapshotAgent {
8991 export interface Options extends MockAgent . Options {
90- mode ?: 'record' | 'playback' | 'update'
92+ mode ?: SnapshotRecorder . SnapshotRecorderMode
9193 snapshotPath ?: string
9294 maxSnapshots ?: number
9395 autoFlush ?: boolean
You can’t perform that action at this time.
0 commit comments