IBM / report-toolkit

A toolkit for consumers of Node.js diagnostic Reports
https://ibm.github.io/report-toolkit
Other
84 stars 10 forks source link

better codecov configuration #89

Open boneskull opened 4 years ago

boneskull commented 4 years ago

We're getting some coverage failures where, ideally, we shouldn't be. if we're adding .mdx files, that should not affect code coverage. if we're editing .yaml, that should not affect code coverage.

stuff to ignore:

other?

boneskull commented 4 years ago

I think this is related to #26

Essentially, the tests are running some stuff via modules, and other stuff via dist files. Because of this rule, we're avoiding loading ES modules when we do e.g., import foo from '@report-toolkit/common'. But in the tests, we load ES modules directly and shim viaesm`.

admittedly, these aren't things that should be mixed and matched, but it was the quickest way to get some unit tests written using ESM.

I was not able to configure esm to use module as a mainFields item (we get some other errors coming out of unexpected). If we can get that to work, it wouldn't require a change to our codebase, since import foo from '@report-toolkit/common' will look into the package's module field, which will load the correct source module.

The issue may actually be in unexpected-rxjs as it looks like the error coming out of unexpected is related to plugins.

boneskull commented 4 years ago

another issue is that the e2e cli tests should use the actual distfile, which will also potentially cause coverage weirdness.

nyc is able to understand, but codecov isn't. maybe a mapping is needed in the codecov.yml? don't know