Open naftalimurgor opened 1 year ago
Seeing this as well with a simpler TS config.
File '/Users/erunion/code/node_modules/jest-extended/types/index.d.ts' is not a module.ts(2306)
import { toContainKey } from 'jest-extended';
expect.extend({ toContainKey });
__tests__/tsconfig.json
:
{
"extends": "../../tsconfig.base.json",
"compilerOptions": {
"baseUrl": ".",
"composite": true,
"outDir": "./dist",
"strict": true,
},
"include": ["**/*.ts", "**/*.js", "**/*.json", "../../global.d.ts"],
"exclude": ["__tests__", "dist", "node_modules"]
}
tsconfig.base.json
:
{
"extends": "ts-node/node14/tsconfig.json",
"ts-node": {
"swc": true
},
"compilerOptions": {
"allowJs": true,
"allowSyntheticDefaultImports": true,
"downlevelIteration": true,
"esModuleInterop": true,
"experimentalDecorators": true,
"forceConsistentCasingInFileNames": true,
"lib": ["ES2021"],
"moduleResolution": "node",
"noErrorTruncation": true,
"noImplicitAny": false, // @todo Remove this when we enable strict mode.
"resolveJsonModule": true,
"skipLibCheck": true,
"strict": false, // Not running in strict mode until we have better type safety .
"target": "ES2021"
}
}
You can post a repo,I think I managed to fix this but can't recall how. You may add a repository to reproduce then I can update with appropriate fix.
Hint: fix probably in thetsconfig.json
Bug
package
version:3.2.4
node
version:10.0.0
npm
(oryarn
) version: yarn1.22.19
TypeScript
:4.0.2
Relevant code or config:tsconfing.json
file looks like this: `What you did:
jest
jest-extended
expect.extend(matchers);