Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
feat(jest-config):Support loading TS config files via docblock loader #15190
feat(jest-config):Support loading TS config files via docblock loader #15190
Changes from 9 commits
7f17fe2
7dab201
7a9e2b1
dc23020
a729f80
849f6b0
1bd881a
b9c6ee5
9cd57e8
9747160
3c321f4
deea0d6
afb4509
d2c3a8d
8b70b95
b05a5f5
4d71390
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
not for this PR, but maybe in a follow-up - should we drop this new env variable and use docblock config instead (like we support for test environment: https://jestjs.io/blog/2022/04/25/jest-28#inline-testenvironmentoptions)? Then people could also e.g. opt into using
swc
(https://typestrong.org/ts-node/docs/swc/)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.
that would be better, will send PR for that
we might also need to add support for swc based loader at some point #12156
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.
This is not working when passing multiple loaders like this
/**@jest-config-loader ts-node esbuild-register*/
it simply returns a string'ts-node esbuild-register'
instead of returning an array of strings['ts-node','esbuild-register']
is this an expected behavior or a bug in
jest-docblock
?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.
that's expected - for it to be an array you'd need to do
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.
I wonder if this needs to be a
Map<TsLoaderModule, Promise<TsLoader>>
? I'm thinking in cases where multi projects are used, and some project uses a different TS loader. That might already not work if the loaders get in the way of each other, tho.Maybe a better thing would just be to save what module was loaded, and then throw an error if later another one is attempted to be used?
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.
I have added integration tests for different loaders in different projects and they seem to be working fine d2c3a8d
do we still need to save the loader and doesn't allow using a different one?