AO store launch with jasmine

A little new to Javascript coding, so please bear with me.

I read the following jasmine link with jscoverage automated testing

However, since I do not have a Ruby project, it seems I did not want this.

Here are the steps I followed:

  • Copy my js file to be tested in the 'input' directory
  • Run the following command: "jscoverage input"
  • Copy my specs and src folders for Jasmine, as well as SpecRunner.html to 'output'
  • Copy the source tool file in src
  • Open jscoverage.html in Chrome
  • Open SpecRunner.html in the Browser Tab

At this point, my Jasmine tests are displayed on the browser page. However, the Summary page displays 0 scanned files, and the Source tab is grayed out.

I know that I ruined something, but I don’t know where. Please help me. Thanks!

+6
source share
2 answers

The correct steps to be followed are:

  • Copy the jasmine files (specifications and src folders for Jasmine, as well as SpecRunner.html) into the "input" directory
  • Run the following command: "jscoverage input"
  • Open jscoverage.html in Firefox (Chrome will not show individual files that have been tested)
  • Open SpecRunner.html in the Browser Tab

This approach has the disadvantage that all files appear, including jasmine related js. But you can select the js file that is being tested and just look at the code coverage for it.

+5
source

The jscoverage standard approach is a tool for the entire code base that you want coverage for, then run the test suite and create a report. This approach is a bit difficult, since the code base only needs a coverage report at a given frequency. Unlike CI tests, how often does a developer really need to know the percentage change in coverage weekly?

The node.js jscoverage project uses the same β€œtoolkit” approach as for the larger jscoverage project, but it can be run from the CLI node in a separate file or from the code of one or more files, since they are called from the tests themselves. Instead of a separate step to the "tool" package of files, jscoverage (confusing name), "tools" during testing.

I am working on a template that allows you to test and test jasmine in a browser or on the CLI using the same source code setting and test configuration. Another beta. Jasmine just in time for the "toolbox" is not yet complete.

https://github.com/d1b1/jasmine-jscoverage

+3
source

Source: https://habr.com/ru/post/910010/


All Articles