Tool/Lib Versions:
"ts-mocha": "^8.0.0",
"ts-node": "^10.3.0",
"chai": "^4.3.4",
Code:
expect(wrapper.find(MyListItem)).to.have.length(3);
Command:
ts-mocha tests/**/*.tsx -r unitTestSetup.ts
My typescript compiler options:
{
"compilerOptions": {
"target": "es5",
"module": "commonjs",
"declaration": true,
"outDir": "./lib",
"strict": true,
"esModuleInterop": true,
},
Error:
tests/index.spec.tsx:41:10 - error TS2695: Left side of comma operator is unused and has no side effects.
41 (0, chai_1.expect)(wrapper.find(MyListItem)).to.have.length(3);
This seems to be caused by if an optional dependency for ts-mocha is not installed. (tsconfig-paths)
Is there a better way to fix this than doing a npm install --force on the ts-mocha package to force it to install tsconfig-paths? (the answer I provided)