Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
chore: make function generic
  • Loading branch information
SimenB committed Jul 27, 2019
commit cb35b6757d1de99b6f97f77df3e45f96507d85b0
6 changes: 3 additions & 3 deletions packages/jest-transform/src/ScriptTransformer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,10 @@ export default class ScriptTransformer {
return fileSource;
}

async requireAndTranspileModule(
async requireAndTranspileModule<ModuleType = any>(
moduleName: string,
callback?: (module: any) => void | Promise<void>,
): Promise<any> {
callback?: (module: ModuleType) => void | Promise<void>,
): Promise<ModuleType> {
// Load the transformer to avoid a cycle where we need to load a
// transformer in order to transform it in the require hooks
this.preloadTransformer(moduleName);
Expand Down