-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
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
Coverage Broken: metrics.isEmpty is not a function at tableRow #5772
Comments
@dazip how does this help? |
The pull request referenced appears to break coverage within jest. In cases where my package-lock.json used version 1.1.4 of istanbul-reports, coverage works. Updating, in which Jest pulls in 1.3.0, and the pull request above, breaks. |
@bcoe I have tried installing multiple times and it seems to have no effect. My dependency tree is:
Also, i'm still on npm v4.2.0 so there is no package lock etc. I think @dazip is right, since Jest is pulling 1.3.0 of istanbul-reports coverage has been broken. |
It worked for me as well now. Not sure what was going on before...thanks! |
PR welcome to bump Jests dependencies to make sure we get the correct versions |
I am running in to this issue as well. Upgrading to the latest version of jest does not appear to help.
|
try |
^got it working. I forgot my lockfile updated as well when I did the upgrade. |
FWIW, I had to manually delete my Things tried with no luck (in no particular order):
|
If you're using only npm (not yarn), delete node_modules and package-lock.json and run |
…kage.lock to fix an issue with Jest metrics reporting (see jestjs/jest#5772).
Fixes “metrics.isEmpty is not a function” when running Jest code coverage. Make sure Jest dependencies are up to date: jestjs/jest#5772 (comment)
@SimenB, Could we force somehow the upgrade of |
For sure, it's just a matter of applying this: diff --git i/packages/jest-cli/package.json w/packages/jest-cli/package.json
index 3e4bfd85..bebedaea 100644
--- i/packages/jest-cli/package.json
+++ w/packages/jest-cli/package.json
@@ -12,9 +12,9 @@
"import-local": "^1.0.0",
"is-ci": "^1.0.10",
"istanbul-api": "^1.3.1",
- "istanbul-lib-coverage": "^1.1.1",
- "istanbul-lib-instrument": "^1.8.0",
- "istanbul-lib-source-maps": "^1.2.1",
+ "istanbul-lib-coverage": "^1.2.0",
+ "istanbul-lib-instrument": "^1.10.1",
+ "istanbul-lib-source-maps": "^1.2.3",
"jest-changed-files": "^22.2.0",
"jest-config": "^22.4.2",
"jest-environment-jsdom": "^22.4.1",
diff --git i/packages/jest-runtime/package.json w/packages/jest-runtime/package.json
index 6ab876ad..c4cb00c4 100644
--- i/packages/jest-runtime/package.json
+++ w/packages/jest-runtime/package.json
@@ -9,7 +9,7 @@
"main": "build/index.js",
"dependencies": {
"babel-core": "^6.0.0",
- "babel-plugin-istanbul": "^4.1.5",
+ "babel-plugin-istanbul": "^4.1.6",
"chalk": "^2.0.1",
"convert-source-map": "^1.4.0",
"exit": "^0.1.2", Not sure which of them matters, but that should be enough to bump things up enough. |
I'm open to apply them all 🤪 |
|
Ok! Will do the PR in a min, thanks @SimenB! |
Had to do this sooner or later: done() signature changed; any argument will be treated as a failure. Note: coverage broken until we/they update istanbul-coverage (jestjs/jest#5772)
Can remove from package.json pending jestjs/jest#5772
Had to do this sooner or later: done() signature changed; any argument will be treated as a failure. Note: coverage broken until we/they update istanbul-coverage (jestjs/jest#5772)
Can remove from package.json pending jestjs/jest#5772
Had to do this sooner or later: done() signature changed; any argument will be treated as a failure. Note: coverage broken until we/they update istanbul-coverage (jestjs/jest#5772)
Can remove from package.json pending jestjs/jest#5772
Had to do this sooner or later: done() signature changed; any argument will be treated as a failure. Note: coverage broken until we/they update istanbul-coverage (jestjs/jest#5772)
Can remove from package.json pending jestjs/jest#5772
Following jestjs/jest#5772
Following jestjs/jest#5772
When can we see the release with this fix? Or it's released? I didn't find this fix in |
@slawiko this should be in jest@23.0.0-beta.2 |
And you don't need jest to bump the version, as they are within semver range. Just update your own lockfile |
@SimenB didn't understand: I have |
You don't need the jest beta, you need |
…kage.lock to fix an issue with Jest metrics reporting (see jestjs/jest#5772).
Had to do this sooner or later: done() signature changed; any argument will be treated as a failure. Note: coverage broken until we/they update istanbul-coverage (jestjs/jest#5772)
Can remove from package.json pending jestjs/jest#5772
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
command run:
jest --forceExit --verbose --bail --useStderr --runInBand --expand --colors --coverage
output:
Failed to write coverage reports: ERROR: TypeError: metrics.isEmpty is not a function STACK: TypeError: metrics.isEmpty is not a function at tableRow (/Users/qtb9604/bmw/packages/http/node_modules/istanbul-reports/lib/text/index.js:133:27) at TextReport.onSummary (/Users/qtb9604/bmw/packages/http/node_modules/istanbul-reports/lib/text/index.js:188:15) at TextReport.onDetail (/Users/qtb9604/bmw/packages/http/node_modules/istanbul-reports/lib/text/index.js:193:17) at Visitor.(anonymous function) [as onDetail] (/Users/qtb9604/bmw/packages/http/node_modules/istanbul-lib-report/lib/tree.js:34:30) at ReportNode.Node.visit (/Users/qtb9604/bmw/packages/http/node_modules/istanbul-lib-report/lib/tree.js:123:17) at /Users/qtb9604/bmw/packages/http/node_modules/istanbul-lib-report/lib/tree.js:116:23 at Array.forEach (native) at visitChildren (/Users/qtb9604/bmw/packages/http/node_modules/istanbul-lib-report/lib/tree.js:115:32) at ReportNode.Node.visit (/Users/qtb9604/bmw/packages/http/node_modules/istanbul-lib-report/lib/tree.js:126:5) at /Users/qtb9604/bmw/packages/http/node_modules/istanbul-lib-report/lib/tree.js:116:23
jest --debug
yields:{ "configs": [ { "automock": false, "browser": false, "cache": true, "cacheDirectory": "/var/folders/t6/0brzsz0s6v5fqttj19rylpn18r1g3z/T/jest_mm3xxb", "clearMocks": false, "coveragePathIgnorePatterns": [ "index.ts", "locales", "src/controllers", "src/middleware", "src/prototypes", "src/types", "tests/unit/mocks" ], "detectLeaks": false, "forceCoverageMatch": [], "globals": { "ts-jest": { "tsConfigFile": "tsconfig.json" } }, "haste": { "providesModuleNodeModules": [] }, "moduleDirectories": [ "node_modules" ], "moduleFileExtensions": [ "ts", "js" ], "moduleNameMapper": {}, "modulePathIgnorePatterns": [], "name": "3fa0a9dc4bb9d4586ae003b68f15eda0", "resetMocks": false, "resetModules": false, "restoreMocks": false, "rootDir": "/Users/qtb9604/vea-server", "roots": [ "/Users/qtb9604/vea-server" ], "runner": "jest-runner", "setupFiles": [], "snapshotSerializers": [], "testEnvironment": "/Users/qtb9604/vea-server/node_modules/jest-environment-node/build/index.js", "testEnvironmentOptions": {}, "testLocationInResults": false, "testMatch": [ "**/tests/**/*.test.(ts)" ], "testPathIgnorePatterns": [ "/node_modules/" ], "testRegex": "", "testRunner": "/Users/qtb9604/vea-server/node_modules/jest-jasmine2/build/index.js", "testURL": "about:blank", "timers": "real", "transform": [ [ "^.+\\.(ts|tsx)$", "/Users/qtb9604/vea-server/node_modules/ts-jest/preprocessor.js" ] ], "transformIgnorePatterns": [ "/node_modules/" ], "watchPathIgnorePatterns": [] } ], "globalConfig": { "bail": false, "changedFilesWithAncestor": false, "collectCoverageFrom": [ "src/**" ], "coverageDirectory": "/Users/qtb9604/vea-server/coverage", "coverageReporters": [ "json", "text", "lcov", "clover" ], "detectLeaks": false, "expand": false, "globalSetup": null, "globalTeardown": null, "listTests": false, "maxWorkers": 7, "noStackTrace": false, "nonFlagArgs": [], "notify": false, "notifyMode": "always", "passWithNoTests": false, "rootDir": "/Users/qtb9604/vea-server", "runTestsByPath": false, "testFailureExitCode": 1, "testPathPattern": "", "testResultsProcessor": null, "updateSnapshot": "new", "useStderr": false, "verbose": null, "watch": false, "watchman": true }, "version": "22.4.2" }
The text was updated successfully, but these errors were encountered: