Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Node ESM configuration w/ CJS & ESM build outputs #81

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
22 changes: 17 additions & 5 deletions jest.config.js → jest.config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
// https://jestjs.io/docs/en/configuration.html

module.exports = {
// ESM config
transform: {
'^.+\\.tsx?$': [
'ts-jest',
{
useESM: true,
},
],
},

// All imported modules in your tests should be mocked automatically
// automock: false,

Expand Down Expand Up @@ -91,8 +101,10 @@ module.exports = {
// An enum that specifies notification mode. Requires { notify: true }
// notifyMode: "failure-change",

// A preset that is used as a base for Jest's configuration
preset: 'ts-jest',
// A preset that is used as a base for Jest's configuration;
// https://kulshekhar.github.io/ts-jest/docs/guides/esm-support/#esm-presets
// If you are using custom transform config, please remove preset from your Jest config to avoid issues that Jest doesn't transform files correctly.
// preset: 'ts-jest',

// Run tests from one or more projects
// projects: undefined,
Expand Down Expand Up @@ -170,9 +182,9 @@ module.exports = {
// transform: undefined,

// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
// transformIgnorePatterns: [
// "/node_modules/"
// ],
transformIgnorePatterns: [
"/node_modules/"
],

// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
// unmockedModulePathPatterns: undefined,
Expand Down
Loading