Monocart - #4230
Open
MicahMaphet wants to merge 7 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
As written, Mocha discovery/coverage setup is likely broken due to an invalid extension configuration and an ESM/CommonJS mismatch in coverage-builder.js that would prevent mcr.config.js from loading.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Switches the monorepo’s JS/TS test coverage tooling from NYC/c8 to Monocart Coverage Reports (mcr) to better support ESM packages while standardizing coverage configuration across packages.
Changes:
- Replaced
nyc/c8coverage invocations withmcr mocha ...across multiple package test scripts. - Added per-package
mcr.config.jsfiles plus a sharedcoverage-builder.jsto centralize thresholds/filtering. - Migrated Mocha configuration from
.mocharc.ymlto.mocharc.jsonand updated a few tests (timeouts + require-based imports for built artifacts).
File summaries
| File | Description |
|---|---|
| packages/crypto-wallet-core/package.json | Switch test script from nyc to mcr. |
| packages/crypto-wallet-core/mcr.config.js | Add Monocart coverage configuration using shared builder. |
| packages/crypto-wallet-core/.nycrc.yml | Remove NYC config. |
| packages/crypto-wallet-core/.mocharc.yml | Remove YAML Mocha config. |
| packages/crypto-wallet-core/.mocharc.json | Add JSON Mocha config for recursive test discovery. |
| packages/crypto-rpc/package.json | Switch docker test coverage to mcr, replace c8 with Monocart dependency. |
| packages/crypto-rpc/mcr.config.js | Add ESM Monocart coverage config. |
| packages/crypto-rpc/coverage-builder.js | Add package-local coverage builder helper (ESM). |
| packages/crypto-rpc/.mocharc.yml | Remove YAML Mocha config. |
| packages/crypto-rpc/.mocharc.json | Add JSON Mocha config. |
| packages/bitcore-wallet-service/package.json | Switch test script from nyc to mcr. |
| packages/bitcore-wallet-service/mcr.config.js | Add Monocart coverage configuration using shared builder. |
| packages/bitcore-wallet-service/.nycrc.yml | Remove NYC config. |
| packages/bitcore-wallet-service/.mocharc.yml | Remove YAML Mocha config. |
| packages/bitcore-wallet-service/.mocharc.json | Add JSON Mocha config. |
| packages/bitcore-wallet-client/test/api.test.ts | Increase suite timeout. |
| packages/bitcore-wallet-client/package.json | Switch test script from nyc to mcr. |
| packages/bitcore-wallet-client/mcr.config.js | Add Monocart coverage configuration using shared builder. |
| packages/bitcore-wallet-client/.nycrc.yml | Remove NYC config. |
| packages/bitcore-wallet-client/.mocharc.yml | Remove YAML Mocha config. |
| packages/bitcore-wallet-client/.mocharc.json | Add JSON Mocha config. |
| packages/bitcore-tss/package.json | Switch mocha coverage script from nyc to mcr. |
| packages/bitcore-tss/mcr.config.js | Add Monocart coverage configuration using shared builder. |
| packages/bitcore-tss/.nycrc.yml | Remove NYC config. |
| packages/bitcore-tss/.mocharc.json | Add JSON Mocha config. |
| packages/bitcore-p2p/mcr.config.js | Add Monocart coverage configuration using shared builder. |
| packages/bitcore-p2p/.nycrc.yml | Remove NYC config. |
| packages/bitcore-p2p-doge/mcr.config.js | Add Monocart coverage configuration using shared builder. |
| packages/bitcore-p2p-doge/.nycrc.yml | Remove NYC config. |
| packages/bitcore-p2p-cash/mcr.config.js | Add Monocart coverage configuration using shared builder. |
| packages/bitcore-p2p-cash/.nycrc.yml | Remove NYC config. |
| packages/bitcore-node/package.json | Switch test script from nyc to mcr; simplify unit/integration mocha invocations. |
| packages/bitcore-node/mcr.config.js | Add Monocart coverage configuration using shared builder. |
| packages/bitcore-node/.nycrc.yml | Remove NYC config. |
| packages/bitcore-node/.mocharc.yml | Remove YAML Mocha config. |
| packages/bitcore-node/.mocharc.json | Add JSON Mocha config. |
| packages/bitcore-mnemonic/mcr.config.js | Add Monocart coverage configuration using shared builder. |
| packages/bitcore-mnemonic/.nycrc.yml | Remove NYC config. |
| packages/bitcore-logging/package.json | Switch test script from nyc to mcr. |
| packages/bitcore-logging/mcr.config.js | Add Monocart coverage configuration using shared builder. |
| packages/bitcore-logging/.nycrc.yml | Remove NYC config. |
| packages/bitcore-logging/.mocharc.yml | Remove YAML Mocha config. |
| packages/bitcore-logging/.mocharc.json | Add JSON Mocha config. |
| packages/bitcore-lib/test/transaction/transaction.js | Adjust timeout configuration for Taproot vector tests. |
| packages/bitcore-lib/mcr.config.js | Add Monocart coverage configuration using shared builder. |
| packages/bitcore-lib/.nycrc.yml | Remove NYC config. |
| packages/bitcore-lib-ltc/mcr.config.js | Add Monocart coverage configuration using shared builder. |
| packages/bitcore-lib-ltc/.nycrc.yml | Remove NYC config. |
| packages/bitcore-lib-doge/mcr.config.js | Add Monocart coverage configuration using shared builder. |
| packages/bitcore-lib-doge/.nycrc.yml | Remove NYC config. |
| packages/bitcore-lib-cash/mcr.config.js | Add Monocart coverage configuration using shared builder. |
| packages/bitcore-lib-cash/.nycrc.yml | Remove NYC config. |
| packages/bitcore-client/test/unit/wallet.test.ts | Switch imports to require for built bitcore-node artifacts; add wallet cleanup. |
| packages/bitcore-client/package.json | Switch test script from nyc (tsx runtime) to mcr (compiled JS). |
| packages/bitcore-client/mcr.config.js | Add Monocart coverage configuration using shared builder. |
| packages/bitcore-client/.nycrc.yml | Remove NYC config. |
| packages/bitcore-client/.mocharc.yml | Remove YAML Mocha config. |
| packages/bitcore-client/.mocharc.json | Add JSON Mocha config. |
| packages/bitcore-cli/package.json | Switch test script from nyc to mcr. |
| packages/bitcore-cli/mcr.config.js | Add Monocart coverage configuration using shared builder. |
| packages/bitcore-cli/.nycrc.yml | Remove NYC config. |
| packages/bitcore-cli/.mocharc.yml | Remove YAML Mocha config. |
| packages/bitcore-cli/.mocharc.json | Add JSON Mocha config. |
| packages/bitcore-build/index.js | Update gulp test task to run mcr mocha. |
| package.json | Replace nyc dev dependency with monocart-coverage-reports. |
| package-lock.json | Lockfile updates reflecting dependency/tooling changes. |
| coverage-builder.js | Add shared Monocart coverage builder helper at repo root. |
Review details
Suppressed comments (1)
coverage-builder.js:52
export defaultis ESM-only; in a CommonJS root package this will throw at load time. Export viamodule.exports(and keep a.defaultalias since callers userequire(...).default).
export default coverageBuilder;
- Files reviewed: 66/69 changed files
- Comments generated: 12
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
monocart copilot review Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description 🪶
Use monocart for coverage because it supports ESM.
Changelog 📝
Testing Notes 🥼
The coverage should all be passing for this PR with the thresholds just a little below the current coverage.
Checklist