-
-
Notifications
You must be signed in to change notification settings - Fork 29
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
autoLoadEntities does not work when using Test.createTestingModule #17
Comments
Hello! any news on that? from what i'm reading in the module code it would be because this line: const key = (preferTsNode && this.config.get('tsNode', Utils_1.Utils.detectTsNode()) && this.config.get('entitiesTs').length > 0) ? 'entitiesTs' : 'entities'; returns "entities" instead of "entitiesTs". Would it come from the fact that jest config says |
You can control that just by passing |
Beautiful i'll try this out! |
Works nicely! |
ts-jest detection will land soon hopefully, related PR adding support for detecting ts-jest: kulshekhar/ts-jest#2717 |
Closing, should work out of box with ts-jest 27.0.4+ and MikroORM v4.5.9+ |
tried ts-node: true in the latest, though I'm not actually certain that's what we're doing. didn't work, same problem. Feels like a hokey fix though. |
|
Describe the bug
I recently switched to the
autoLoadEntities
way to load entities.Imagine the following "flow"
This works perfectly while running the application.
But when testing this, the entities do not get loaded.
Gives me the following stack trace
I can work around it by putting a MikroOrmModule.forFeature for all entities referenced when initializing the testing module but this is less than optimal.
Versions
The text was updated successfully, but these errors were encountered: