Test and coverage on process build

hi support team,
I’m following this link ( Javascript/Typescript test coverage) to configure for javascript coverage (Angular)

It suggested that we should use:

- name: Install dependencies
   run: yarn
- name: Test and coverage
   run: yarn jest --coverage

But:

  1. Could I only work with Karma? how can I configure Karma instead of using “run yarn jest --coverage”
  2. I tried to use run: npm test → it runs ng test → error because there is no understand ng:: mean.
  3. Can I create result report file in locally machine, and sonar can scan it?

Any help will be appriciated. I’m stuck for several days for this configuration.

Hi,

Welcome to the community!

Unfortunately, configuring your tests is out of scope for this community. We only provide guidance on Jest as a courtesy.

 
Ann

To continue on @ganncamp’s response – as long as you have a coverage tool that produces an lcov report (it looks like there’s a Karma plugin for this), the report can be passed to sonar.javascript.lcov.reportPaths.