code-coverage icon indicating copy to clipboard operation
code-coverage copied to clipboard

[Feature request] Example for stenciljs

Open maxkarkowski opened this issue 5 years ago • 3 comments

Is there a possibility to have an example for a stencilJS project?

maxkarkowski avatar Feb 17 '21 15:02 maxkarkowski

Can you set up a simple StencilJS project repo that I could fork?

bahmutov avatar Feb 26 '21 20:02 bahmutov

sure: i have a very simple stencil + cypress project set up here https://github.com/maxkarkowski/stencil-example

maxkarkowski avatar Mar 03 '21 14:03 maxkarkowski

// stencil.config.ts
const istanbul = require('rollup-plugin-istanbul');

export const config: Config = {
  plugins: [
    istanbul({
      exclude: ['**.spec.ts']
    })
  ]
};

Instrumenting worked, my compiled assets contained all sorts of gibberish. I also confirmed window.__coverage__ etc, I installed the @cypress/code-coverage plugin but the test runner errored out, I guess because of lazy loading components.. When the test runner tried to generate a report it was unable to open

cy.task('coverageReport') failed with the following error no such file or directory, open NOENT @lazy-browser-entrypoint?app-data=conditional

tfrijsewijk avatar Apr 18 '21 15:04 tfrijsewijk