question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Coverage Broken: metrics.isEmpty is not a function at tableRow

See original GitHub issue

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" }

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:24 (7 by maintainers)

github_iconTop GitHub Comments

12reactions
SimenBcommented, Mar 12, 2018

try yarn remove jest && yarn add --dev jest (or npm equivalent) to amke sure all of Jest’s dependencies are updated as well

10reactions
benjamincharitycommented, Mar 12, 2018

FWIW, I had to manually delete my yarn.lock file to get this working. Much thanks to others in this thread that pointed me in the correct direction 🙏 … I was banging my head around for a while.


Things tried with no luck (in no particular order):

  • manually remove the yarn cache file from my machine
  • tell yarn to clean up the cache
  • manually lock istanbul deps to earlier versions
  • remove node_modules and reinstall
  • bump jest back down to 22.4.0
Read more comments on GitHub >

github_iconTop Results From Across the Web

Coverage Broken: metrics.isEmpty is not a function at ...
command run: jest --forceExit --verbose --bail --useStderr --runInBand --expand --colors --coverage output: Failed to write coverage ...
Read more >
Jest coverage does not count throwing an error in coverage
My understanding is that the final two test cases ("An empty input array should trigger an error" and "no inputs should throw a...
Read more >
Table Objects — ezodf 0.3.0 documentation
The Table object represents a fixed sized table with size[0] rows and size[1] columns. Every cell contains a Cell object, even empty cells...
Read more >
Changelog — great_expectations documentation
BREAKING : Data Docs rendering is now handled in the new Modular Expectations, which means that any custom expectation rendering needs to be...
Read more >
permalink - Board descriptions
View a portion of raw data, explore schemas and calculate data coverage metrics. ✓. Histogram, Create a histogram of your data and filter...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found