Skip to content

Commit

Permalink
chore: generics
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-ogawa committed Oct 30, 2024
1 parent 806c966 commit e20cc25
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/snapshot/src/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ export class SnapshotManager {
addSnapshotResult(this.summary, result)
}

resolvePath(testPath: string, context?: any): string {
resolvePath<T = any>(testPath: string, context?: T): string {
const resolver
= this.options.resolveSnapshotPath || (() => {
= this.options.resolveSnapshotPath<T> || (() => {
return join(
join(dirname(testPath), '__snapshots__'),
`${basename(testPath)}${this.extension}`,
Expand Down
2 changes: 1 addition & 1 deletion packages/snapshot/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export interface SnapshotStateOptions {
snapshotEnvironment: SnapshotEnvironment
expand?: boolean
snapshotFormat?: PrettyFormatOptions
resolveSnapshotPath?: (path: string, extension: string, context?: any) => string
resolveSnapshotPath?: <T = any>(path: string, extension: string, context?: T) => string
}

export interface SnapshotMatchOptions {
Expand Down

0 comments on commit e20cc25

Please sign in to comment.