Closed pfgallagher closed 5 years ago
Hi @pfgallagher, thanks for reporting this. Which version of liftr-tscov are you using? I have tried to recreate this but I did not seem to get an untyped for a try/catch block.
Version 1.4.1.
Here's a contrived example:
test.ts:
const testFunc = () => {
try {
return;
} catch (error) {
console.log(error);
}
};
When I run tscov -p /file/path/to -f test.ts -d
, this is what returns:
------------- uncovered types ---------------
file/path/to/test.ts: 4:14 - error
file/path/to/test.ts: 5:21 - error
----------------- coverage ------------------
5 - max reachable type coverage
3 - types covered
2 - types uncovered
Running it with the --debug
flag doesn't seem to offer any additional insight.
Fix merged
As far as I'm aware, it's not possible to type the parameter for a catch block. Here is a relevant discussion of error handling on the TS repo.
Currently, tscov flags these parameters as untyped even though typing them seemingly isn't possible.