Closed francoismassart closed 3 weeks ago
Extract from the (huge) logs:
{
"config": {
"automock": false,
"cache": true,
"cacheDirectory": "/private/var/folders/xd/2v4dq4r13_1c3kysysjkldd00000gn/T/jest_dx",
"clearMocks": false,
"collectCoverageFrom": [],
"coverageDirectory": "/Users/fma/eslint-plugin-demo-typescript/coverage",
"coveragePathIgnorePatterns": [
"/node_modules/"
],
"cwd": "/Users/fma/eslint-plugin-demo-typescript",
"detectLeaks": false,
"detectOpenHandles": false,
"errorOnDeprecated": false,
"extensionsToTreatAsEsm": [],
"fakeTimers": {
"enableGlobally": false
},
"forceCoverageMatch": [],
"globals": {
"ts-jest": {}
},
"haste": {
"computeSha1": false,
"enableSymlinks": false,
"forceNodeFilesystemAPI": true,
"throwOnModuleCollision": false
},
"id": "0e1a76e07665af9d7f1061e1c4b02546",
"injectGlobals": true,
"moduleDirectories": [
"node_modules"
],
"moduleFileExtensions": [
"js",
"mjs",
"cjs",
"jsx",
"ts",
"tsx",
"json",
"node"
],
"moduleNameMapper": [],
"modulePathIgnorePatterns": [],
"openHandlesTimeout": 1000,
"prettierPath": "prettier",
"resetMocks": false,
"resetModules": false,
"restoreMocks": false,
"rootDir": "/Users/fma/eslint-plugin-demo-typescript",
"roots": [
"/Users/fma/eslint-plugin-demo-typescript"
],
"runner": "/Users/fma/eslint-plugin-demo-typescript/node_modules/.pnpm/jest-runner@29.7.0/node_modules/jest-runner/build/index.js",
"sandboxInjectedGlobals": [],
"setupFiles": [],
"setupFilesAfterEnv": [],
"skipFilter": false,
"slowTestThreshold": 5,
"snapshotFormat": {
"escapeString": false,
"printBasicPrototype": false
},
"snapshotSerializers": [],
"testEnvironment": "/Users/fma/eslint-plugin-demo-typescript/node_modules/.pnpm/jest-environment-node@29.7.0/node_modules/jest-environment-node/build/index.js",
"testEnvironmentOptions": {},
"testLocationInResults": false,
"testMatch": [
"**/tests/**/*.ts"
],
"testPathIgnorePatterns": [
"/node_modules/"
],
"testRegex": [],
"testRunner": "/Users/fma/eslint-plugin-demo-typescript/node_modules/.pnpm/jest-circus@29.7.0/node_modules/jest-circus/runner.js",
"transform": [
[
"^.+\\.tsx?$",
"/Users/fma/eslint-plugin-demo-typescript/node_modules/.pnpm/ts-jest@29.1.4_@babel+core@7.24.7_esbuild@0.21.5_jest@29.7.0_typescript@5.4.5/node_modules/ts-jest/dist/index.js",
{}
]
],
"transformIgnorePatterns": [
"/node_modules/",
"\\.pnp\\.[^\\/]+$"
],
"watchPathIgnorePatterns": []
},
"logLevel": 20,
"namespace": "backports",
"package": "ts-jest",
"version": "29.1.4"
}
The issue has been solved on my side.
In order to use, the RuleTester
from @typescript-eslint/rule-tester
, we must:
tsconfig.json
with:
{
"compilerOptions": {
"module": "nodenext",
"moduleResolution": "nodenext"
}
}
More info can be found on v6
: Cannot find module @typescript-eslint/*
or its corresponding type declarations.
You can use
bundler
,node16
, ornodenext
formoduleResolution
.
eslint
with v8
, typescript-eslint
does not support v9
yet
Version
29.1.4
Steps to reproduce
feat/test
branchpnpm i
pnpm build
runs finepnpm test
which executesjest
fails with this error:tests/my-rule.spec.ts:1:28 - error TS2307: Cannot find module '@typescript-eslint/rule-tester' or its corresponding type declarations.
Expected behavior
As the code build fine, the issue seems to be related to
ts-jest
Actual behavior
Debug log
Logs are too long to be pasted directly into issue: https://justpaste.it/e6401
Additional context
No response
Environment