You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been having difficulty trying to get tests passing per the resources provided in the docs. There is a reference to resolve the circular reference issue appearing for the context (and maybe also singleton) solutions. However, there is no instruction within the docs that shows how to configure the .jest.config.js to leverage the .tsconfig file.
The following solution resolves that:
// jest.config.js
module.exports = {
clearMocks: true,
preset: "ts-jest",
testEnvironment: "node",
setupFilesAfterEnv: ["<rootDir>/singleton.ts"],
globals: {
"ts-jest": {
tsconfig: "./.tsconfig",
// set global config for ts-jest
},
},
};
with that update to jest.config.js in place, the following error goes away and the tests pass:
However, the error still persists within the file itself.
the following provides a bandaid solution in the event that a linter is pipeline is getting jammed up.
Here is the repo I created (based off of the Prisma docs)
I've been having difficulty trying to get tests passing per the resources provided in the docs. There is a reference to resolve the circular reference issue appearing for the context (and maybe also singleton) solutions. However, there is no instruction within the docs that shows how to configure the
.jest.config.js
to leverage the.tsconfig
file.The following solution resolves that:
with that update to
jest.config.js
in place, the following error goes away and the tests pass:However, the error still persists within the file itself.
the following provides a bandaid solution in the event that a linter is pipeline is getting jammed up.
It's also worth noting, the solution used above evidently works without having
"strictNullChecks": true
within.tsconfig
The text was updated successfully, but these errors were encountered: