1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-22 09:57:02 +01:00

Update Jest config to avoid transpiling dependencies (#16068)

* Use stable version of Jest

* Update Jest config
This commit is contained in:
Maarten Zuidhoorn 2022-10-04 17:58:22 +02:00 committed by seaona
parent f75672ef1f
commit 7c90fe56a0
4 changed files with 375 additions and 375 deletions

View File

@ -58,17 +58,11 @@ module.exports = {
testTimeout: 2500, testTimeout: 2500,
// We have to specify the environment we are running in, which is jsdom. The // We have to specify the environment we are running in, which is jsdom. The
// default is 'node'. This can be modified *per file* using a comment at the // default is 'node'. This can be modified *per file* using a comment at the
// head of the file. So it may be worth while to switch to 'node' in any // head of the file. So it may be worthwhile to switch to 'node' in any
// background tests. // background tests.
testEnvironment: 'jsdom', testEnvironment: 'jsdom',
// Our configuration somehow is calling into the esm folder / files of testEnvironmentOptions: {
// some modules. Jest supports ESM but our code is not set to emit ESM files customExportConditions: ['node', 'node-addons'],
// so we are telling jest to use babel to transform the node_modules listed. },
// Note: for some reason I could not hammer down to the node_modules
// installed in @metamask/controllers so I had to just blanket specify all
// of the @metamask/controllers folder.
transformIgnorePatterns: [
'/node_modules/(?!(multiformats|uuid|nanoid|@metamask/controllers|@metamask/snap-controllers|@metamask/rpc-methods)/)',
],
workerIdleMemoryLimit: '500MB', workerIdleMemoryLimit: '500MB',
}; };

View File

@ -14,4 +14,7 @@ module.exports = {
'^.+\\.mdx$': '@storybook/addon-docs/jest-transform-mdx', '^.+\\.mdx$': '@storybook/addon-docs/jest-transform-mdx',
}, },
testEnvironment: 'jsdom', testEnvironment: 'jsdom',
testEnvironmentOptions: {
customExportConditions: ['node', 'node-addons'],
},
}; };

View File

@ -350,9 +350,9 @@
"history": "^5.0.0", "history": "^5.0.0",
"improved-yarn-audit": "^3.0.0", "improved-yarn-audit": "^3.0.0",
"ini": "^3.0.0", "ini": "^3.0.0",
"jest": "^29.0.0-alpha.5", "jest": "^29.1.2",
"jest-canvas-mock": "^2.3.1", "jest-canvas-mock": "^2.3.1",
"jest-environment-jsdom": "^29.0.0-alpha.4", "jest-environment-jsdom": "^29.1.2",
"jest-it-up": "^2.0.2", "jest-it-up": "^2.0.2",
"jsdom": "^11.2.0", "jsdom": "^11.2.0",
"koa": "^2.7.0", "koa": "^2.7.0",

729
yarn.lock

File diff suppressed because it is too large Load Diff