Fix reseting modules in jest and config (#7494)
* Fix reseting modules in jest and config we have lib folders inside the source folders which should not be ignored. * Add codemods lib folder * Support mjs * improve ignore pattern
This commit is contained in:
parent
f9857ca6ba
commit
a340a2614f
21
package.json
21
package.json
@ -78,10 +78,12 @@
|
||||
},
|
||||
"jest": {
|
||||
"collectCoverageFrom": [
|
||||
"packages/*/src/**/*.mjs",
|
||||
"packages/*/src/**/*.js",
|
||||
"codemods/*/src/**/*.mjs",
|
||||
"codemods/*/src/**/*.js"
|
||||
],
|
||||
"testRegex": "./(packages|codemods)/[^/]+/test/.+\\.js$",
|
||||
"testRegex": "./(packages|codemods)/[^/]+/test/.+\\.m?js$",
|
||||
"testPathIgnorePatterns": [
|
||||
"/node_modules/",
|
||||
"/test/fixtures/",
|
||||
@ -90,24 +92,23 @@
|
||||
"/test/tmp/",
|
||||
"/test/__data__/",
|
||||
"/test/helpers/",
|
||||
"<rootDir>/test/warning.js",
|
||||
"<rootDir>/test/warning\\.js",
|
||||
"<rootDir>/build/",
|
||||
"_browser.js"
|
||||
"_browser\\.js"
|
||||
],
|
||||
"testEnvironment": "node",
|
||||
"setupTestFrameworkScriptFile": "<rootDir>/test/testSetupFile.js",
|
||||
"transformIgnorePatterns": [
|
||||
"/node_modules/",
|
||||
"/test/fixtures/",
|
||||
"/test/tmp/",
|
||||
"/test/__data__/",
|
||||
"/lib/"
|
||||
],
|
||||
"modulePaths": [
|
||||
"<rootDir>/packages/"
|
||||
"<rootDir>/packages/babel-standalone/babel(\\.min)?\\.js",
|
||||
"<rootDir>/packages/babel-preset-env-standalone/babel-preset-env(\\.min)?\\.js",
|
||||
"/test/(fixtures|tmp|__data__)/",
|
||||
"<rootDir>/(packages|codemods)/[^/]+/lib/"
|
||||
],
|
||||
"modulePathIgnorePatterns": [
|
||||
"/test/fixtures/",
|
||||
"/test/tmp/",
|
||||
"/test/__data__/",
|
||||
"<rootDir>/build/"
|
||||
]
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ describe("@babel/register - caching", () => {
|
||||
|
||||
beforeEach(() => {
|
||||
// Since lib/cache is a singleton we need to fully reload it
|
||||
jest.resetModuleRegistry();
|
||||
jest.resetModules();
|
||||
const cache = require("../lib/cache");
|
||||
|
||||
load = cache.load;
|
||||
|
||||
@ -55,7 +55,7 @@ describe("@babel/register", function() {
|
||||
currentHook = null;
|
||||
currentOptions = null;
|
||||
sourceMapSupport = false;
|
||||
jest.resetModuleRegistry();
|
||||
jest.resetModules();
|
||||
});
|
||||
|
||||
test("registers hook correctly", () => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user