From d052f81fc608db3aa6d1f1985125356ca3154cdd Mon Sep 17 00:00:00 2001 From: Simen Bekkhus Date: Sun, 14 Mar 2021 10:57:15 +0100 Subject: [PATCH] fix test --- packages/babel-jest/src/index.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/babel-jest/src/index.ts b/packages/babel-jest/src/index.ts index 0c6f0c7dda84..d6f54b92430d 100644 --- a/packages/babel-jest/src/index.ts +++ b/packages/babel-jest/src/index.ts @@ -147,20 +147,22 @@ async function loadBabelOptionsAsync( return addIstanbulInstrumentation(options, jestTransformOptions); } -const createTransformer: CreateTransformer = (userOptions = {}) => { +const createTransformer: CreateTransformer = userOptions => { + const inputOptions = userOptions ?? {}; + const options = { - ...userOptions, + ...inputOptions, caller: { name: 'babel-jest', supportsDynamicImport: false, supportsExportNamespaceFrom: false, supportsStaticESM: false, supportsTopLevelAwait: false, - ...userOptions.caller, + ...inputOptions.caller, }, compact: false, - plugins: userOptions.plugins ?? [], - presets: (userOptions.presets ?? []).concat(jestPresetPath), + plugins: inputOptions.plugins ?? [], + presets: (inputOptions.presets ?? []).concat(jestPresetPath), sourceMaps: 'both', } as const;