You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
is this issue currently blocking your project? (yes/no): no
is this issue affecting a production system? (yes/no): yes
Context
node version: v14.15.4
module version with issue: "@hapi/lab": "^24.1.1"
last module version without issue: unknown
environment (e.g. node, browser, native): node
used with (e.g. hapi application, another framework, standalone, ...): not relevant
any other relevant information: Project is developed in TypeScript
What are you trying to achieve or the steps to reproduce?
On HTML code coverage report, code is shown in JavaScript, instead of TypeScript. Also, code introduced by the TypeScript compiler (i.e __importStar, __setModuleDefaul) is marked as not covered.
I suspect this is a duplicate of #952, which also has a workaround you may find useful. I agree it's not ideal behavior, but I don't have a sense for how extensive of a fix would be needed.
Presently lab only supports js code, and you need to transform any typescript before it can be checked. Unfortunately, this conversion can inject hidden (and possibly untestable) lines of code.
It can also convert what is a single statement into multiple statements. Eg. variable ?? 'default' is 2 statements with a ES2019 target, thus requiring an extra test for coverage.
Support plan
Context
What are you trying to achieve or the steps to reproduce?
On HTML code coverage report, code is shown in JavaScript, instead of TypeScript. Also, code introduced by the TypeScript compiler (i.e
__importStar
,__setModuleDefaul
) is marked as not covered.$ lab --coverage --reporter html --output ./out/coverage.html --coverage-path src --coverage-all \ --coverage-pattern '^(?!.*\\.spec\\.ts)(?:.*\\.ts)$'
What was the result you got?
What result did you expect?
I expected to see the original source, in TypeScript, with the appropriate status about code coverage.
The text was updated successfully, but these errors were encountered: