From 91230d41cbb72a4f6ea93eb7a9a26c7fb23a7387 Mon Sep 17 00:00:00 2001 From: Matt Seddon <37993418+mattseddon@users.noreply.github.com> Date: Thu, 11 May 2023 08:07:40 +1000 Subject: [PATCH] Update coverage path ignore patterns (#3859) --- extension/jest.config.js | 6 +++--- extension/src/test/suite/index.ts | 7 ++++++- languageServer/jest.config.js | 3 +-- webview/jest.config.js | 14 ++++++-------- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/extension/jest.config.js b/extension/jest.config.js index 26719224c2..683a7de224 100644 --- a/extension/jest.config.js +++ b/extension/jest.config.js @@ -2,14 +2,14 @@ module.exports = { coverageDirectory: 'coverage/jest', - coveragePathIgnorePatterns: ['/src/test/'], + coveragePathIgnorePatterns: ['/src/test/', '/node_modules/'], coverageReporters: ['json'], testEnvironment: 'node', testPathIgnorePatterns: [ '/src/test/', '/dist/', - '/.vscode-test', - '/.wdio-vscode-service' + '/.vscode-test/', + '/.wdio-vscode-service/' ], transform: { '^.+\\.(t|j)sx?$': ['@swc/jest'] diff --git a/extension/src/test/suite/index.ts b/extension/src/test/suite/index.ts index 2db1d11809..e0754b8a42 100644 --- a/extension/src/test/suite/index.ts +++ b/extension/src/test/suite/index.ts @@ -11,7 +11,12 @@ function setupNyc() { cache: true, cacheDir: join(cwd, '.cache', 'nyc'), cwd, - exclude: [...defaultExclude, '**/test/**', '**/.vscode-test/**'], + exclude: [ + ...defaultExclude, + '**/test/**', + '**/.vscode-test/**', + '**/.wdio-vscode-service/**' + ], extensions: ['ts'], hookRequire: true, hookRunInContext: true, diff --git a/languageServer/jest.config.js b/languageServer/jest.config.js index 59f31b1164..e8a53bfb8a 100644 --- a/languageServer/jest.config.js +++ b/languageServer/jest.config.js @@ -1,7 +1,6 @@ module.exports = { - collectCoverageFrom: ['src/**/*.{ts,tsx}', '!**/*.test.*', '!src/test/*'], coverageDirectory: 'coverage/jest', - coveragePathIgnorePatterns: ['/src/test/'], + coveragePathIgnorePatterns: ['/src/test/', '/node_modules/'], coverageReporters: ['json'], testEnvironment: 'node', testPathIgnorePatterns: ['/dist/'], diff --git a/webview/jest.config.js b/webview/jest.config.js index df940756d4..8e75fbf456 100644 --- a/webview/jest.config.js +++ b/webview/jest.config.js @@ -1,15 +1,13 @@ /* global module */ module.exports = { - collectCoverageFrom: [ - 'src/**/*.{ts,tsx}', - '!**/*.test.*', - '!src/stories/**/*.{ts,tsx}', - '!src/test/*', - '!src/shared/components/icons/*', - '!src/util/wdyr.ts' - ], coverageDirectory: 'coverage/jest', + coveragePathIgnorePatterns: [ + '/src/test/', + '/node_modules/', + '/src/stories/', + '/src/util/wdyr.ts' + ], coverageReporters: ['json'], globals: { __webpack_public_path__: true