theintern / intern

A next-generation code testing stack for JavaScript.
https://theintern.io/
Other
4.36k stars 309 forks source link

HTML coverage report is not outputting correctly #1062

Closed agubler closed 4 years ago

agubler commented 4 years ago

Expected behavior

The HTML report to be output correctly and no handlebar wanrings printed to the terminal

Current behavior

The HTML report is empty and handlebars warnings are printed to the terminal

Handlebars: Access has been denied to resolve the property "statements" because it is not an "own property" of its parent.
You can add a runtime option to disable the check or this warning:
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details
Handlebars: Access has been denied to resolve the property "branches" because it is not an "own property" of its parent.
You can add a runtime option to disable the check or this warning:
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details
Handlebars: Access has been denied to resolve the property "functions" because it is not an "own property" of its parent.
You can add a runtime option to disable the check or this warning:
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details
Handlebars: Access has been denied to resolve the property "lines" because it is not an "own property" of its parent.
You can add a runtime option to disable the check or this warning:
See https://handlebarsjs.com/api-reference/runtime-options.html#options-to-control-prototype-access for details

Possible solution

Possibly update dependency that uses handlebars?

Steps to reproduce (for bugs)

  1. Clone github.com/dojo/framework
  2. npm install
  3. npm test
  4. Open the coverage report coverage/html-report/index.html

Environment

Intern version: 4.3.5 Node version: 12.13.1 NPM version: 6.12.1 Browser version: N/A

Additional information

N/A

jason0x43 commented 4 years ago

The problem doesn't occur with a dev install of framework (i.e., what you get by running npm install in framework), which uses handlebars 4.5.3. However, it does occur if you're using handlebars 4.7.2, which is what users of framework would probably end up with.

jason0x43 commented 4 years ago

This is due to an intentional change to handlebars in 4.6 (https://github.com/wycats/handlebars.js/issues/1642). It's not an issue for Intern 5 since it's using istanbul-reports@2, which dropped handlebars. However, we'll either need to pin handlebars for Intern 4.x, or see if Istanbul-reports@2 will work without too much of an overhaul.

jason0x43 commented 4 years ago

This should also be updated in Intern 4.8 and 4.x. We can backport it as necessary.

jason0x43 commented 4 years ago

4.8 and 4.x have been updated.