Skip to content

chore: update all test scripts to remove coverage flag #10582

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

Merged
merged 9 commits into from
Feb 27, 2025
Merged
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
7 changes: 2 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,14 @@ jobs:

# collect coverage on the primary node version
# we don't collect coverage on other node versions so they run faster
# note that we don't do this as a single `run` with a flag because some
# packages don't collect coverage on purpose, so forcing `--coverage=true`
# would override the config
- name: Run unit tests with coverage for ${{ matrix.package }}
if: env.PRIMARY_NODE_VERSION == matrix.node-version && matrix.os == 'ubuntu-latest'
run: npx nx test ${{ matrix.package }}
run: npx nx run ${{ matrix.package }}:test -- --coverage
env:
CI: 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
1 change: 0 additions & 1 deletion jest.config.base.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ const path = require('node:path');
// @ts-check
/** @type {import('@jest/types').Config.InitialOptions} */
module.exports = {
collectCoverage: true,
collectCoverageFrom: ['src/**/*.{js,jsx,ts,tsx}'],
coverageReporters: ['lcov'],
moduleFileExtensions: [
Expand Down
2 changes: 1 addition & 1 deletion packages/ast-spec/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const baseConfig = require('../../jest.config.base.js');
/** @type {import('@jest/types').Config.InitialOptions} */
module.exports = {
...baseConfig,
collectCoverage: false,
setupFilesAfterEnv: [
...baseConfig.setupFilesAfterEnv,
'./tests/util/setupJest.ts',
],
coveragePathIgnorePatterns: ['/fixtures/', '/node_modules/'],
};
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",
"check-types": "npx nx typecheck"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
"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": "cross-env NODE_OPTIONS=\"--experimental-vm-modules\" jest --logHeapUsage",
"test-single": "cross-env NODE_OPTIONS=\"--experimental-vm-modules\" jest --no-coverage",
"check-types": "npx nx typecheck"
},
Expand Down
1 change: 0 additions & 1 deletion packages/integration-tests/jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const { tseslintPackages } = require('./tools/pack-packages');
/** @type {import('@jest/types').Config.InitialOptions} */
module.exports = {
...require('../../jest.config.base.js'),
collectCoverage: false,
globals: {
tseslintPackages,
},
Expand Down
2 changes: 1 addition & 1 deletion packages/parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,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",
"check-types": "npx nx typecheck"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/rule-tester/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,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": "npx jest",
"check-types": "npx nx typecheck"
},
"//": "NOTE - AJV is out-of-date, but it's intentionally synced with ESLint - https://github.com/eslint/eslint/blob/ad9dd6a933fd098a0d99c6a9aa059850535c23ee/package.json#L70",
Expand Down
3 changes: 2 additions & 1 deletion packages/scope-manager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,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": "jest",
"check-types": "npx nx typecheck"
},
"dependencies": {
Expand All @@ -55,6 +55,7 @@
"@types/glob": "*",
"@typescript-eslint/typescript-estree": "8.25.0",
"glob": "*",
"jest": "29.7.0",
"jest-specific-snapshot": "*",
"make-dir": "*",
"prettier": "^3.2.5",
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 @@ -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",
"check-types": "npx nx typecheck"
},
"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 @@ -49,7 +49,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",
"check-types": "npx nx typecheck"
},
"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 @@ -51,7 +51,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",
"check-types": "npx nx typecheck"
},
"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 @@ -60,7 +60,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",
"check-types": "npx nx typecheck"
},
"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 @@ -44,7 +44,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",
"check-types": "npx nx typecheck"
},
"dependencies": {
Expand Down
1 change: 1 addition & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5812,6 +5812,7 @@ __metadata:
"@typescript-eslint/typescript-estree": 8.25.0
"@typescript-eslint/visitor-keys": 8.25.0
glob: "*"
jest: 29.7.0
jest-specific-snapshot: "*"
make-dir: "*"
prettier: ^3.2.5
Expand Down
Loading