diff --git a/test/lib/compiler/hooks/tsconfig-paths.hook.spec.ts b/test/lib/compiler/hooks/tsconfig-paths.hook.spec.ts index 78682a7f0..34f8c7c62 100644 --- a/test/lib/compiler/hooks/tsconfig-paths.hook.spec.ts +++ b/test/lib/compiler/hooks/tsconfig-paths.hook.spec.ts @@ -21,6 +21,7 @@ function createSpec( options, }); const output = new Map(); + const transformer = tsconfigPathsBeforeHookFactory(options); program.emit( undefined, (fileName, data) => { @@ -29,7 +30,7 @@ function createSpec( undefined, undefined, { - before: [tsconfigPathsBeforeHookFactory(options)!], + before: transformer ? [transformer] : [], }, ); return output;