Closed HendrikJanssen closed 1 year ago
Latest commit: 09e2a8703bc92668ba02a18bc2bf0f5898b8e68b
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
It seems the moduleNameMapper
config option in jest.config.js
was misconfigured and failed to execute tests when importing from the "compiled" module. I fixed it by using
moduleNameMapper: {
'^apollo-angular': '<rootDir>/src/',
}
Instead of
moduleNameMapper: {
'^apollo-angular': '<rootDir>',
}
While at it, I removed the absolute path for the resolver
option (unnecessary) and migrated the "ts-jest" config options to be included in the transform
options of jest-preset-angular
as detailed in https://thymikee.github.io/jest-preset-angular/docs/getting-started/options#exposed-configuration since the globals
way of doing it is deprecated.
Alright, the demo
project had trouble building: "Module apollo-angular
could not be found".
I fixed it by pointing the paths
option in the tsconfig.app.json
to the built apollo-angular package, since pointing it to src/
would surface some compilation errors because of typescript. That does actually seem like a dirty hack though, not sure how module resolution worked before that, could you point me in the right direction @PowerKiKi ?
Actually your workaround makes sense to me. And I don't have any specific knowledge to share about how it used to work before.
@kamilkisiela do you have any insight regarding module resolutions ?