Skip to content

Instantly share code, notes, and snippets.

@lukeapage
Last active June 22, 2019 20:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukeapage/c7844b3bd7fab7eed260bfef387848b9 to your computer and use it in GitHub Desktop.
Save lukeapage/c7844b3bd7fab7eed260bfef387848b9 to your computer and use it in GitHub Desktop.
Testing istanbul html-spa

Generate the coverage files for istanbul:

  1. run npm i
  2. run npm i git+https://github.com/coreyfarrell/nyc.git#node8 -D
  3. change "locv" reporter to "html-spa"
  4. run npm link packages/istanbul-reports
  5. Unless istanbuljs/istanbuljs#428 has been merged, go to packages/istanbul-reports/lib/none/index.js and change the implementation to
class NoneReport extends ReportBase {
    constructor() {
        super();
    }
}
  1. Fix the merge reports to work - edit monorepo-merge-reports.js to have the following e.g. an explicit path to nyc
glob.sync('packages/*/.nyc_output').forEach(nycOutput => {
    const { status, stderr, stdout, output } = spawnSync(
        'node',
        [
            'node_modules/nyc/bin/nyc.js',
            'merge',
  1. test with npm test

Next, to test html-spa changes:

  1. inside packages/istanbul-reports run npm run prepare
  2. At this point, re-run the report with npm test on the root, or if you just changed the css/js copy the html-spa folder to the generated folder.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment