README
jest-transform-stealthy-require
Transforms stealthy-require
calls into jest.isolateModules()
Motivation
The purpose of this module is to address Jest + stealthy-require compatibility issue which causes issues like Unable to expose method "then" on modules that depend on stealthy-require.
Getting started
Installation
npm install --save-dev jest-transform-stealthy-require
Jest configuration
For request-promise/request-promise-native issue
Jest
jest.config.js
const { requestPromise } = require('jest-transform-stealthy-require/dist/presets');
module.exports = {
// ...
transform: {
...requestPromise.transform
},
transformIgnorePatterns: [requestPromise.transformIgnorePattern]
};
Jest + babel-jest
jest.config.js
const { requestPromise } = require('jest-transform-stealthy-require/dist/presets');
module.exports = {
// ...
transform: {
...requestPromise.transform,
"^.+\\.[t|j]sx?