From 41dd658fbb3c837588243ee0b4747e55623daf98 Mon Sep 17 00:00:00 2001 From: Kyle Holmberg Date: Thu, 7 Mar 2024 18:23:20 +0900 Subject: [PATCH 1/2] update nyc coverage inclusions --- nyc.config.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/nyc.config.js b/nyc.config.js index 23705050b..80974cb91 100644 --- a/nyc.config.js +++ b/nyc.config.js @@ -1,4 +1,9 @@ module.exports = { - include: ['pages/**/*.js', 'common/**/*.js', 'components/**/*.js', 'decorators/**/*.js'], - exclude: ['pages/api/__coverage__.js'], + include: [ + 'pages/**/*.{js,ts,tsx}', + 'common/**/*.{js,ts,tsx}', + 'components/**/*.{js,ts,tsx}', + 'decorators/**/*.{js,ts,tsx}', + ], + exclude: ['pages/api/__coverage__.{js,ts}'], }; From b388325167dea70a98440ec54d01a8465d26e674 Mon Sep 17 00:00:00 2001 From: Kyle Holmberg Date: Thu, 7 Mar 2024 18:40:52 +0900 Subject: [PATCH 2/2] another whack --- vitest.config.mts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/vitest.config.mts b/vitest.config.mts index c594f3c78..6c9a8f58a 100644 --- a/vitest.config.mts +++ b/vitest.config.mts @@ -29,7 +29,13 @@ export default defineConfig({ }, coverage: { reportsDirectory: './vitest-coverage', + include: [ + 'common/**/*.{js,ts,tsx}', + 'components/**/*.{js,ts,tsx}', + 'decorators/**/*.{js,ts,tsx}', + ], exclude: [ + // Irrelevant configs and local-only scripts 'coverage/**', '{cypress,vitest}-coverage/**', 'dist/**', @@ -39,17 +45,23 @@ export default defineConfig({ '{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*', 'vitest.{workspace,projects}.[jt]s?(on)', '.{eslint,mocha,prettier}rc.{?(c|m)js,yml}', + 'scripts/**', + 'test-utils/**', + + // Folders covered by integration tests 'node_modules/**', 'cypress/**', 'common/config/**', 'common/styles/**', 'common/constants/**', - 'scripts/**', - 'test-utils/**', + + // No real logic to test here 'common/utils/api-utils.{[jt]s}', 'components/ZipRecruiterJobs/ZipRecruiterJobs.{[jt]s}', 'components/Press/PressLinks/Articles.{[jt]s}', 'components/Timeline/historyData.{[jt]s}', + + // Don't collect coverage from import/export mappers 'common/(.*)/index.{[jt]s}', 'components/(.*)/index.{[jt]s}', ],