Files
flipper/desktop/jest.config.js
Anton Nikolaev 018c1f828c Fix jest auto-mocks hoisting on Windows
Summary: ts-jest transformation was not applied on Windows because of wrong pattern in jest.config. Because of this jest.mock calls was not hoisted to the top and were applied after imports.

Reviewed By: mweststrate

Differential Revision: D21379004

fbshipit-source-id: ec52f98228c5d9e58c0832f2ad201a36d6c8534e
2020-05-04 04:49:21 -07:00

27 lines
784 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
*/
module.exports = {
transform: {
'^.*__tests__(/|\\\\).*\\.tsx?$': 'ts-jest',
'\\.(js|tsx?)$': '<rootDir>/scripts/jest-transform.js',
},
setupFiles: ['<rootDir>/scripts/jest-setup.js'],
moduleNameMapper: {
'^flipper$': '<rootDir>/app/src',
'^flipper-doctor$': '<rootDir>/doctor/src',
'^flipper-pkg$': '<rootDir>/pkg/src',
'^flipper-pkg-lib$': '<rootDir>/pkg-lib/src',
},
clearMocks: true,
coverageReporters: ['json-summary', 'lcov', 'html'],
testMatch: ['**/**.node.(js|jsx|ts|tsx)'],
testEnvironment: 'jest-environment-jsdom-sixteen',
};