Skip to content

chore: control coverage by COLLECT_COVERAGE env var #10689

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,10 @@ jobs:
run: npx nx test ${{ matrix.package }}
env:
CI: true
COLLECT_COVERAGE: true
- name: Run unit tests for ${{ matrix.package }}
if: env.PRIMARY_NODE_VERSION != matrix.node-version || matrix.os != 'ubuntu-latest'
run: npx nx test ${{ matrix.package }} --coverage=false
run: npx nx test ${{ matrix.package }}
env:
CI: true

Expand Down
2 changes: 1 addition & 1 deletion jest.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const path = require('node:path');
// @ts-check
/** @type {import('@jest/types').Config.InitialOptions} */
module.exports = {
collectCoverage: true,
collectCoverage: process.env.COLLECT_COVERAGE === 'true',
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
coverageReporters: ['lcov'],
moduleFileExtensions: [
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin-internal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"postclean": "rimraf dist && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
"lint": "npx nx lint",
"test": "jest --coverage",
"test": "jest",
"typecheck": "npx tsc --noEmit"
},
"dependencies": {
Expand Down
4 changes: 2 additions & 2 deletions packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@
"generate:breaking-changes": "tsx tools/generate-breaking-changes.mts",
"generate:configs": "npx nx generate-configs repo",
"lint": "npx nx lint",
"test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules\" jest --coverage --logHeapUsage",
"test-single": "cross-env NODE_OPTIONS=\"--experimental-vm-modules\" jest --no-coverage",
"test": "cross-env NODE_OPTIONS=\"--experimental-vm-modules\" jest --logHeapUsage",
"test-single": "cross-env NODE_OPTIONS=\"--experimental-vm-modules\" jest",
"typecheck": "tsc --noEmit"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/integration-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"scripts": {
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
"lint": "npx nx lint",
"test": "jest --no-coverage",
"test": "jest",
"typecheck": "tsc --noEmit"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
"postclean": "rimraf dist && rimraf _ts4.3 && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
"lint": "npx nx lint",
"test": "jest --coverage",
"test": "jest",
"typecheck": "tsc --noEmit"
},
"peerDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion packages/rule-schema-to-typescript-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"generate-sponsors": "tsx ./src/generate-sponsors.ts",
"lint": "npx nx lint",
"postinstall-script": "tsx ./src/postinstall.ts",
"test": "npx jest --coverage",
"test": "jest",
"typecheck": "tsc --noEmit"
},
"dependencies": {
Expand All @@ -41,6 +41,7 @@
},
"devDependencies": {
"@jest/types": "29.6.3",
"jest": "29.7.0",
"typescript": "*"
},
"funding": {
Expand Down
3 changes: 2 additions & 1 deletion packages/rule-tester/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"lint": "npx nx lint",
"pretest-eslint-base": "tsc -b tsconfig.build.json",
"test-eslint-base": "mocha --require source-map-support/register ./tests/eslint-base/eslint-base.test.js",
"test": "npx jest --coverage",
"test": "jest",
"typecheck": "tsc --noEmit"
},
"//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70",
Expand All @@ -67,6 +67,7 @@
"eslint-visitor-keys": "^4.2.0",
"espree": "^10.3.0",
"esprima": "^4.0.1",
"jest": "29.7.0",
"mocha": "^10.4.0",
"sinon": "^16.1.3",
"source-map-support": "^0.5.21",
Expand Down
2 changes: 1 addition & 1 deletion packages/scope-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
"generate-lib": "npx nx generate-lib repo",
"lint": "npx nx lint",
"test": "npx nx test --code-coverage",
"test": "npx nx test",
"typecheck": "npx nx typecheck"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/type-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"postclean": "rimraf dist && rimraf _ts3.4 && rimraf _ts4.3 && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
"lint": "npx nx lint",
"test": "jest --coverage",
"test": "jest",
"typecheck": "tsc --noEmit"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript-eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"postclean": "rimraf dist && rimraf _ts4.3 && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
"lint": "nx lint",
"test": "jest --coverage --passWithNoTests",
"test": "jest --passWithNoTests",
"typecheck": "tsc --noEmit"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/typescript-estree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"postclean": "rimraf dist && rimraf _ts4.3 && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
"lint": "npx nx lint",
"test": "jest --coverage --runInBand --verbose",
"test": "jest --runInBand --verbose",
"typecheck": "tsc --noEmit"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
"postclean": "rimraf dist && rimraf _ts3.4 && rimraf _ts4.3 && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
"lint": "npx nx lint",
"test": "jest --coverage",
"test": "jest",
"typecheck": "tsc --noEmit"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/visitor-keys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"postclean": "rimraf dist && rimraf _ts3.4 && rimraf _ts4.3 && rimraf coverage",
"format": "prettier --write \"./**/*.{ts,mts,cts,tsx,js,mjs,cjs,jsx,json,md,css}\" --ignore-path ../../.prettierignore",
"lint": "npx nx lint",
"test": "jest --coverage",
"test": "jest",
"typecheck": "tsc --noEmit"
},
"dependencies": {
Expand Down
2 changes: 2 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5816,6 +5816,7 @@ __metadata:
"@jest/types": 29.6.3
"@typescript-eslint/type-utils": 8.21.0
"@typescript-eslint/utils": 8.21.0
jest: 29.7.0
natural-compare: ^1.4.0
prettier: ^3.2.5
typescript: "*"
Expand All @@ -5837,6 +5838,7 @@ __metadata:
eslint-visitor-keys: ^4.2.0
espree: ^10.3.0
esprima: ^4.0.1
jest: 29.7.0
json-stable-stringify-without-jsonify: ^1.0.1
lodash.merge: 4.6.2
mocha: ^10.4.0
Expand Down
Loading