Skip to content

Commit

Permalink
Update Jest config
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrtenz committed Oct 4, 2022
1 parent 8e50700 commit f0e0bb4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
14 changes: 4 additions & 10 deletions jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,11 @@ module.exports = {
testTimeout: 2500,
// 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
// 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.
testEnvironment: 'jsdom',
// Our configuration somehow is calling into the esm folder / files of
// some modules. Jest supports ESM but our code is not set to emit ESM files
// 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)/)',
],
testEnvironmentOptions: {
customExportConditions: ['node', 'node-addons'],
},
workerIdleMemoryLimit: '500MB',
};
3 changes: 3 additions & 0 deletions jest.stories.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ module.exports = {
'^.+\\.mdx$': '@storybook/addon-docs/jest-transform-mdx',
},
testEnvironment: 'jsdom',
testEnvironmentOptions: {
customExportConditions: ['node', 'node-addons'],
},
};

0 comments on commit f0e0bb4

Please sign in to comment.