-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
No resolver for typescript with ts-jest #387
Comments
Related to the ts-jest kulshekhar/ts-jest#2144 |
@cojack thanks for the report. Just to check, do your migrations work ok when running normally (i.e. outside of jest)? Either way, it shouldn't be too hard to find a workaround which detects ts-jest and lets you require typescript from that environment too. Will add a test for this use case as well. In the meantime did you try adding a custom resolver that works like the default one but skips file extension validation? It'd be something like: migrations: {
glob: 'a/b/*.ts',
resolve: params => ({ ...params, ...require(params.path!) }),
} |
@cojack fix released in 3.0.0-beta.9 ( |
@mmkal yes, now it works, thanks! |
Version: 3.0.0-beta.8
Storage: SequelizeStorage
Sequelize: 6.1.1
Node: 15.0.1
Dev setup: Typescript@3.9.6
When I try to run test with jest with preset: ts-jest I've got a error back:
So I have no clue, how this should working. Any advice? I've tried to add a
require('ts-node/register');
at the top of the entry point, where it was a jest.config.js file, also I tried to run jest with configuration like:without success, also tried to add this require into the test file, also without success, same thing happen.
Also repository doesn't provide any example of tests that works that way, only README with hidden section explains how it should works, but it doesn't.
So my question is: does it works? And if so, how I should configure it to works that way.
Regards.
The text was updated successfully, but these errors were encountered: