diff --git a/jestSupport/preprocessor.js b/jestSupport/preprocessor.js index 0e81cb382..32d691cdd 100644 --- a/jestSupport/preprocessor.js +++ b/jestSupport/preprocessor.js @@ -14,6 +14,16 @@ const transformer = require('../packager/transformer.js'); module.exports = { process(src, file) { + // Don't transform node_modules, except react-tools which includes the + // untransformed copy of React + if ( + file.match(/node_modules\/(?!react-tools\/)/) || + // (TODO: balpert, cpojer): Remove this once react is updated to 0.14 + file.endsWith('performanceNow.js') + ) { + return src; + } + return transformer.transform(src, file).code; },