Files
flipper/desktop/scripts/jest-transform.js
Anton Nikolaev b0a0b0f355 Babel transformations refactoring
Summary: Just a small refactoring to only create array with plugins once. This should make transformations a bit faster as all these methods are called many times for each file in the project.

Reviewed By: passy

Differential Revision: D21308498

fbshipit-source-id: 0ed47f13cebfebd2992817caa207dc55f1dbeb0a
2020-04-30 04:29:41 -07:00

30 lines
683 B
JavaScript

/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
const isFB = require('./isFB');
if (isFB && process.env.FLIPPER_FB === undefined) {
process.env.FLIPPER_FB = 'true';
}
process.env.FLIPPER_TEST_RUNNER = 'true';
// eslint-disable-next-line import/no-unresolved
const {transform} = require('../babel-transformer/lib/transform-jest');
module.exports = {
process(src, filename, config, options) {
return transform({
src,
filename,
config,
options: {...options, isTestRunner: true},
});
},
};