How to check code coverage in Qunit test framework

406 Views Asked by At

We have tried to implement Istanbul and Karma both in separate workspaces.

Istanbul:- We have installed nyc packages to run test cases. After that when we run nyc qunit, we are getting below error in config.js file. not ok 1 test\config.js > Failed to load the test file with error: ReferenceError: requirejs is not defined

For Karma: In other case with Karma, Here also I am getting error of requirejs is not defined, config.js file is not required when we are working with Karma. Here we are getting an error in the main.js file. Its not accepting import statement "import ../src/js/tests/unit/align.js" I tried to use require instead of import but again its giving error (convert to ES6 module)

For test runner we are using puppeteer, But i am not sure if we can see code coverage with puppeteer

0

There are 0 best solutions below