Open pmunin opened 2 years ago
Are you minifying the code? e
sounds like a minified identifier.
It does look like minifier, but I didn't change anything else in my configs. And once I rolled back those dependencies (jest + ts-ject) to older versions - it started working fine again. So it's obviously the problem in ts-jest.
Here is my jest.config:
module.exports = {
preset: 'ts-jest',
testEnvironment: 'node',
modulePathIgnorePatterns: ['<rootDir>/dist/'],
moduleNameMapper: {
'@/(.+)': '<rootDir>/src/$1'
},
clearMocks: true,
resetMocks: true,
testMatch: ['**/tests/**/*.[jt]s?(x)', '<rootDir>/src/**/*.test.ts'],
testPathIgnorePatterns: ['<rootDir>/tests/helpers', '<rootDir>/tests/fixtures', '<rootDir>/tests/dbaccess', '<rootDir>/tests/setupTests.ts'],
setupFilesAfterEnv: ['<rootDir>/tests/setupTests.ts'],
testTimeout: 30000
}
here is my tsconfig.json:
{
"extends": "@sindresorhus/tsconfig",
"compilerOptions": {
"module": "commonjs",
"target": "es2018",
"esModuleInterop": true,
"sourceMap": true,
"outDir": "dist",
"baseUrl": "./src",
"paths": {
"@/*": ["./*"]
},
"noUncheckedIndexedAccess": false,
"noPropertyAccessFromIndexSignature": false
},
"exclude": ["node_modules", "dist"],
"include": ["src"]
}
I experience similar problem in mocha unit tests (will check if it also affects production code) - seeing wrong argument name in error message.
Simple code:
All of a sudden started giving me the following error message:
Previously it was giving me the right message
This behavior happens during jest test run.
The changes I made in my package.json/devDependencies: