Skip to content

Draft: Set coverageProvider to v8 in jest.config.base.js

Rahul Chanila requested to merge rchanila-add-jest-coverage-provider into master

What does this MR do and why?

Coverage report is incorrect: https://github.com/vuejs/vue-jest/issues/480

In example MR Comparing the output between:

Without coverageProvider, default value is set to babel https://jestjs.io/docs/cli#--coverageproviderprovider

yarn jest --coverage \
--coverageReporters=text \
--collectCoverageFrom=ee/app/assets/javascripts/integrations/edit/components/sections/google_cloud_iam.vue \
ee/spec/frontend/integrations/edit/components/sections/google_cloud_iam_spec.js

&

with v8 set as coverageProvider:

yarn jest --coverage \
--coverageProvider=v8 \
--coverageReporters=text \
--collectCoverageFrom=ee/app/assets/javascripts/integrations/edit/components/sections/google_cloud_iam.vue \
ee/spec/frontend/integrations/edit/components/sections/google_cloud_iam_spec.js

we can see quite a difference in the reported coverage

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

Edited by Rahul Chanila

Merge request reports