Skip to content

Commit e20cc25

Browse files
committed
chore: generics
1 parent 806c966 commit e20cc25

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/snapshot/src/manager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ export class SnapshotManager {
2323
addSnapshotResult(this.summary, result)
2424
}
2525

26-
resolvePath(testPath: string, context?: any): string {
26+
resolvePath<T = any>(testPath: string, context?: T): string {
2727
const resolver
28-
= this.options.resolveSnapshotPath || (() => {
28+
= this.options.resolveSnapshotPath<T> || (() => {
2929
return join(
3030
join(dirname(testPath), '__snapshots__'),
3131
`${basename(testPath)}${this.extension}`,

packages/snapshot/src/types/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export interface SnapshotStateOptions {
2020
snapshotEnvironment: SnapshotEnvironment
2121
expand?: boolean
2222
snapshotFormat?: PrettyFormatOptions
23-
resolveSnapshotPath?: (path: string, extension: string, context?: any) => string
23+
resolveSnapshotPath?: <T = any>(path: string, extension: string, context?: T) => string
2424
}
2525

2626
export interface SnapshotMatchOptions {

0 commit comments

Comments
 (0)