-
Notifications
You must be signed in to change notification settings - Fork 11
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
chore: refactor Jest configuration to allow verbatimModuleSyntax
#32
chore: refactor Jest configuration to allow verbatimModuleSyntax
#32
Conversation
|
||
const jestConfig: JestConfigWithTsJest = { | ||
preset: 'ts-jest/presets/default-esm', // or other ESM presets | ||
extensionsToTreatAsEsm: ['.ts'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests were failing in this package, because the extensionsToTreatAsEsm
option was missing. I simply copied the options to make it similar to other files.
tsconfig.json
Outdated
"include": [ | ||
"src/**/*.ts" | ||
] | ||
} No newline at end of file | ||
"include": ["**/src/**/*.ts"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently with "src/**/*.ts"
no files are included and TS is complaining. Not sure what was the exact idea here. Perhaps "include": []
was intended?
"ts-node": { | ||
"moduleTypes": { | ||
"jest.config.ts": "cjs" | ||
} | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like it does nothing in this setup.
export = jestConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the difference between export default
& export equals
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@juanjoDiaz One detail which might be important. I was playing with Might be this is something you would like to double check. Reference: microsoft/TypeScript#52669 (comment) |
Fixes #27
For reference see TypeScript documentation:
The syntax in this PR follows the one seen in the documentation. That is the change needed to allow
verbatimModuleSyntax: true
. If you really need it.