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())
62
62
expectType < Promise < void > > ( snapshotAgent . loadSnapshots ( ) )
63
63
expectType < Promise < void > > ( snapshotAgent . loadSnapshots ( './custom.json' ) )
64
64
expectType < SnapshotRecorder > ( snapshotAgent . getRecorder ( ) )
65
- expectType < 'record' | 'playback' | 'update' > ( snapshotAgent . getMode ( ) )
65
+ expectType < SnapshotRecorder . SnapshotRecorderMode > ( snapshotAgent . getMode ( ) )
66
66
expectType < void > ( snapshotAgent . clearSnapshots ( ) )
67
67
68
68
// New snapshot management methods
@@ -361,9 +361,9 @@ expectAssignable<SnapshotAgent.Options>({
361
361
const playbackAgent = new SnapshotAgent ( { mode : 'playback' , snapshotPath : './test.json' } )
362
362
const updateAgent = new SnapshotAgent ( { mode : 'update' , snapshotPath : './test.json' } )
363
363
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 ( ) )
367
367
}
368
368
369
369
{
Original file line number Diff line number Diff line change @@ -18,9 +18,11 @@ declare class SnapshotRecorder {
18
18
}
19
19
20
20
declare namespace SnapshotRecorder {
21
+ type SnapshotRecorderMode = 'record' | 'playback' | 'update'
22
+
21
23
export interface Options {
22
24
snapshotPath ?: string
23
- mode ?: 'record' | 'playback' | 'update'
25
+ mode ?: SnapshotRecorderMode
24
26
maxSnapshots ?: number
25
27
autoFlush ?: boolean
26
28
flushInterval ?: number
@@ -77,7 +79,7 @@ declare class SnapshotAgent extends MockAgent {
77
79
saveSnapshots ( filePath ?: string ) : Promise < void >
78
80
loadSnapshots ( filePath ?: string ) : Promise < void >
79
81
getRecorder ( ) : SnapshotRecorder
80
- getMode ( ) : 'record' | 'playback' | 'update'
82
+ getMode ( ) : SnapshotRecorder . SnapshotRecorderMode
81
83
clearSnapshots ( ) : void
82
84
resetCallCounts ( ) : void
83
85
deleteSnapshot ( requestOpts : any ) : boolean
@@ -87,7 +89,7 @@ declare class SnapshotAgent extends MockAgent {
87
89
88
90
declare namespace SnapshotAgent {
89
91
export interface Options extends MockAgent . Options {
90
- mode ?: 'record' | 'playback' | 'update'
92
+ mode ?: SnapshotRecorder . SnapshotRecorderMode
91
93
snapshotPath ?: string
92
94
maxSnapshots ?: number
93
95
autoFlush ?: boolean
You can’t perform that action at this time.
0 commit comments