Skip to content

Commit fe806ab

Browse files
committed
workaround for crash
1 parent 7edcccc commit fe806ab

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

.changeset/early-frogs-study.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

packages/jest-preset/src/index.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -236,16 +236,20 @@ function transformRules(targetPlatform) {
236236
return { [key]: require.resolve("./assetFileTransformer.js") };
237237
}
238238

239-
/** @type {(defaultPlatform?: string, userOptions?: InitialOptions) => InitialOptions} */
240-
module.exports = (
239+
/**
240+
* @param {string=} defaultPlatform
241+
* @param {InitialOptions=} userOptions
242+
* @returns {InitialOptions}
243+
*/
244+
function getPreset(
241245
defaultPlatform,
242246
{
243247
moduleNameMapper: userModuleNameMapper,
244248
transform: userTransform,
245249
transformIgnorePatterns: userTransformIgnorePatterns,
246250
...userOptions
247251
} = {}
248-
) => {
252+
) {
249253
const searchPaths = { paths: [process.cwd()] };
250254
const [targetPlatform, platformPath] = getTargetPlatform(
251255
defaultPlatform,
@@ -280,4 +284,6 @@ module.exports = (
280284
],
281285
...userOptions,
282286
};
283-
};
287+
}
288+
289+
module.exports = getPreset;

0 commit comments

Comments
 (0)