Open cortexcompiler opened 1 month ago
PR is welcome
You should use utility functions like createDefaultEsmPreset
for the example codes in the documentation.
const { createDefaultEsmPreset } = require('ts-jest');
const defaultEsmPreset = createDefaultEsmPreset({
// some options
});
module.exports = {
...defaultEsmPreset
}
I'm working on #4433 to adjust the preset page to inform about switching to use utility functions as best practices
Version
29.2
Steps to reproduce
This is a documentation bug. The Use ESM presets section appears to have a redundant
transform
config in the example. Perhaps I am misunderstanding, but it looks like it was copied from the Manual configuration section.From looking at the
ts-jest/presets/default-esm
preset code, it seems to essentially resolve to:This makes me question why the example that uses this default also includes:
If I am not mistaken I would be happy to make the updates to: https://github.com/kulshekhar/ts-jest/blob/main/website/docs/guides/esm-support.md
Expected behavior
I would expect the example configs to look like this:
Actual behavior
The example configs look like:
Debug log
N/A
Additional context
No response
Environment