scalameta/munit
64.3
Adequate · 20 September 2026
6.4k
lines of production code
Scala
with Java
1
measurement over time
What this system is
MUnit is a multi-platform testing framework for Scala that supports JVM, Scala.js, and Scala Native. It provides a structured API for defining test suites with synchronous and asynchronous fixtures, along with rich assertion capabilities including configurable diff reporting and source location tracking. The system integrates with build tools via the JUnit interface and includes infrastructure for automated test report generation and cross-platform compatibility layers.
How it got here
2020 — MUnit framework initial implementation and multi-platform support
26 changes.
This period marks the foundational development of the MUnit testing framework, establishing its core API, fixture lifecycle, and assertion infrastructure. It simultaneously introduces cross-platform compatibility for JVM, Scala.js, and Scala Native, alongside the integration of the junit-interface library. The work also includes setting up the build toolchain, automating release testing, and launching the project's documentation website.
2021–2024 — Platform support and diff customization
9 changes.
The project expanded platform compatibility by introducing JS-specific IO abstractions, Native platform support, and a JUnit interface module for Scala.js and Scala Native. Concurrently, it enhanced the testing experience by adding configurable ANSI color support and custom printers to the diff reporting system, while restoring binary compatibility and improving macro reliability.
Features
Add ANSI color support and string printing utilities for diff output
The console module now includes AnsiColors and Printers to handle colored terminal output and formatted string representation for diffs. AnsiColors provides constants for various ANSI escape codes (e.g., LightRed, Green) and utilities to apply or strip these codes, respecting the NO\_COLOR environment variable to disable colors when requested. Printers offers functions to format strings for display, including escaping special characters and handling multiline strings, while ensuring ANSI codes are filtered out in the final plain-text output.
munit-diff/shared/src/main/scala/munit/diff/console · high confidence
Add JS-specific internal IO implementation for file operations
The \munit/js\ module now includes a new \munit.internal.io\ package that provides JavaScript-specific implementations for file system operations. This includes \File\, \Files\, \Paths\, and \JSIO\ classes that wrap Node.js APIs (and JSDOM fallbacks) to support file existence checks, reading, and path resolution within the Scala.js environment, enabling Munit to perform IO-dependent tests in JS contexts.
munit/js/src/main/scala/munit/internal/io · high confidence
Add JUnit interface support for Scala Native
This change introduces the JUnit interface implementation for Scala Native, enabling MUnit tests to run under the JUnit runner protocol on Native platforms. It adds JUnitTask.scala to handle task execution and runner instantiation, and MUnitRunNotifier.scala to translate MUnit test events into JUnit notifications using concurrent data structures for thread safety.
munit/js/src/main/scala/munit/internal/junitinterface, munit/native/src/main/scala/munit/internal/junitinterface · high confidence
Add JUnit interface support for Scala.js and Scala Native
Introduces a new \munit/js-native\ module that provides a JUnit-compatible test framework implementation for Scala.js and Scala Native targets. This enables Munit tests to be discovered and executed by build tools and IDEs that rely on the sbt JUnit interface (such as SBT itself via \--logger=sbt\), supporting features like tag-based filtering, colored console output, and duration reporting.
munit/js-native · high confidence
Add Scala Native support via new PlatformCompat implementation
This change introduces the first-class support for Scala Native in MUnit by adding a new \PlatformCompat\ implementation in the \munit.native\ module. The new code provides the necessary runtime infrastructure for Native, including an execution context, async test execution, and a timeout mechanism that respects the \munitTimeout\ setting. It also includes a shim for the \java.lang.annotation.Annotation\ trait to satisfy API requirements, enabling MUnit tests to run on the Scala Native platform.
munit/native/src/main/scala/munit/internal · high confidence
Add Scala.js support via platform-specific internal components
This change introduces the necessary internal infrastructure to run MUnit on Scala.js. It adds \PlatformCompat.scala\ for the JS platform, which provides a non-blocking execution context, async test execution via promises, and a timer-based timeout mechanism suitable for single-threaded environments. It also includes \InvocationTargetException\ and \UndeclaredThrowableException\ stubs to handle exception wrapping in the absence of certain JVM-specific features, enabling the framework to operate correctly on JavaScript targets.
munit/js/src/main/scala/munit/internal · high confidence
Add automated test report generation and upload to Google Cloud Storage
The MUnit sbt plugin now automatically generates structured JSON test reports and uploads them to a configurable Google Cloud Storage bucket. This feature introduces new sbt settings (such as \munitBucketName\, \munitRepository\, \munitRef\, and \munitSha\) that default to environment variables like \GITHUB\_REPOSITORY\ and \GITHUB\_SHA\ for CI integration. The plugin handles authentication via \GOOGLE\_APPLICATION\_CREDENTIALS\ or \GOOGLE\_APPLICATION\_CREDENTIALS\_JSON\, manages retry logic for uploads, and includes a local listener for saving reports to disk. This allows users to persist and access detailed test outcomes directly from their cloud storage.
munit-sbt · high confidence
Add platform-specific IO abstraction for Native
A new \PlatformIO\ abstraction has been introduced in the \munit.internal.io\ package to provide platform-specific file system operations. While a JVM implementation already existed, this change adds a corresponding \PlatformIO.scala\ file for the Native platform, enabling consistent IO handling across both targets.
munit/jvm/src/main/scala/munit/internal/io, munit/native/src/main/scala/munit/internal/io · high confidence
Add scripts to support Scala Native and automate release testing
The repository now includes a new \bin/native\_setup.sh\ script that configures the build environment for Scala Native by installing necessary dependencies (such as sbt, Boehm GC, and re2) on macOS and Linux. Additionally, a \bin/test-release.sh\ script has been added to validate new releases by resolving artifacts across multiple Scala versions (2.12, 2.13, 3.0.0) and platforms (JVM, Native, Scala.js) using Coursier.
bin · high confidence
Adds Scala 2 macro compatibility layer for location and clue generation
A new \MacroCompat\ object has been introduced in the shared Scala 2 source directory to provide macro-based implementations for generating \Location\ and \Clue\ instances, as well as capturing compile errors. This change establishes the underlying macro infrastructure required for the framework's assertion and debugging features on Scala 2, complementing the existing Scala 3 support.
munit/shared/src/main/scala-2 · high confidence
Initial implementation of the MUnit testing framework core
This change introduces the foundational components of the MUnit testing library, including the \Suite\ base class for defining tests, the \Runner\ for executing tests via the JUnit interface, and the \Formatter\ for displaying colored test results. It also adds internal utilities for stack trace filtering (\StackMarker\) and color handling (\Colors\), establishing the basic infrastructure required to run and report test outcomes.
munit · high confidence
Initial launch of the MUnit documentation website
The MUnit documentation site is now live, providing users with structured guides on getting started, assertions, fixtures, filtering, and integrations (including ScalaCheck and external tools). The site features a blog section, GitHub repository links, Algolia-powered search, and syntax highlighting for code examples.
website · high confidence
Introduce internal console utilities for test output formatting
Added new internal classes \Lines\, \Printers\, and \StackTraces\ to the \munit.internal.console\ package to handle test result presentation. \Lines\ provides logic for locating source files and formatting code snippets around assertion failures, including support for Windows paths. \Printers\ implements a pretty-printer for values (including \Clues\) optimized for generating readable diffs, and includes a method to escape non-visible characters in test names. \StackTraces\ offers utilities to trim irrelevant framework frames from exception stack traces, resulting in cleaner error output for users.
munit/shared/src/main/scala/munit/internal/console · high confidence
Introduce internal junit-interface and MUnit test tags
This change integrates the junit-interface library into the MUnit codebase, adding Java classes (such as EventDispatcher, JUnitTask, and RunSettings) that bridge JUnit runners to the sbt testing protocol, enabling MUnit to execute and report JUnit-style tests. It also adds MUnit-specific test tags (Pending, Ignore, Only, Flaky, Fail, Slow) and a PendingComment tag in the shared Scala package, allowing users to mark tests with these statuses. Additionally, a Scala.js-specific path implementation (MunitPath) is added to support file operations on JavaScript platforms.
repository · high confidence
JVM test framework integration via JUnit interface
MUnit now includes a JVM-specific Framework class that implements the sbt.testing interface, enabling seamless integration with build tools like sbt. This change introduces a custom fingerprint for MUnit suites and registers the MUnitRunner as the execution engine, allowing users to run MUnit tests directly within the JVM environment using standard JUnit-compatible tooling.
munit/jvm/src/main/scala/munit · high confidence
MUnit introduces a new fixture lifecycle and assertion framework
This release restructures the core testing API with a new fixture model (AnyFixture, Fixture, FutureFixture) that supports both synchronous and asynchronous setup/teardown via beforeAll/afterAll and beforeEach/afterEach hooks. The assertion layer is rebuilt around a Compare type-class for flexible value comparison, introducing Clue/Clues for richer failure context, assertMatches for partial-function predicates, and improved array comparison diagnostics. The MUnitRunner orchestrates these changes, ensuring proper fixture ordering, async test support, and better error handling for suite and test lifecycle failures.
munit/shared/src/main/scala/munit · high confidence
MUnit landing page now displays IDE support and feature highlights
The website's English index page has been updated to showcase MUnit's key capabilities, including source locations for errors, helpful diffs for case classes, highlighted stack traces, and IDE support for IntelliJ and VS Code. The page now features specific images illustrating these features and includes logos for Metals and IntelliJ IDEA to demonstrate integration.
website/pages · high confidence
Behavioural changes
Add Scala 2.13 compatibility layer for internal utilities
The framework now supports Scala 2.13 by introducing version-specific compatibility shims in the \munit.internal.Compat\ object. For Scala 2.13, the library uses native \productElementNames\ and \collectionClassName\ methods, while pre-2.13 versions fall back to \Iterator.continually("")\ and \stringPrefix\ respectively, ensuring consistent internal behavior across Scala versions.
munit/shared/src/main/scala-2.13, munit/shared/src/main/scala-pre-2.13 · high confidence
Add Scala Native compatibility for JUnit assumption and comparison exceptions
The Scala Native module now includes implementations of JUnit's \AssumptionViolatedException\ and \ComparisonFailure\ classes. This addition allows tests relying on these specific JUnit exception types to compile and run correctly on the Scala Native platform, resolving previous compilation errors and ensuring proper handling of assumption violations and comparison failures.
munit/native/src/main/scala/org · high confidence
Introduce configurable diff reporting with ANSI and custom printers
The diff reporting logic in munit-diff now supports configurable options via DiffOptions, allowing users to control ANSI color usage, context size, and line display. A new optional value printer can be provided to customize how values are formatted in diff output, and the deprecated Diffs object is marked for removal in favor of the new Diff class.
munit-diff/shared/src/main/scala/munit/diff · high confidence
JVM-specific timeout and async execution implementation
The JVM platform now uses a dedicated \PlatformCompat\ implementation that introduces a daemon thread scheduler to enforce test timeouts via \TimeoutException\ and supports truly asynchronous test execution through \ExecutionContext.global\. This change ensures that the \munitTimeout\ setting is respected for non-Future tests and prevents the JVM from hanging on exit by using daemon threads for internal scheduling.
munit/jvm/src/main/scala/munit/internal · high confidence
Restored binary compatibility and improved macro reliability
The library restores backward compatibility with munit-scalacheck by re-introducing the deprecated FutureCompat object, which provides extension methods for Future operations. Additionally, the Location macro implementation has been updated to be hermetic by resolving file paths relative to the current working directory, ensuring consistent test reporting regardless of the execution context.
munit/shared/src/main/scala/munit/internal · high confidence
Scala 3 compatibility layer for location and compile-time error reporting
Added Scala 3-specific compatibility implementations for core testing features. The new \Compat.scala\ provides access to \productElementNames\ and \collectionClassName\ required by Scala 3 APIs. The \MacroCompat.scala\ file introduces Scala 3 macro implementations for \Location\ generation (using \Position.ofMacroExpansion\ for accurate file/line info) and \Clue\ generation. Crucially, it adds a \transparent inline\ \compileErrors\ macro that leverages \scala.compiletime.testing.typeCheckErrors\ to capture compilation errors, ensuring that test assertions for compile-time failures are independent of terminal settings and reproducible.
munit/shared/src/main/scala-3 · high confidence
Upgrade scalafmt to v3.11.5 and reconfigure formatting rules
The project's code formatter has been upgraded from scalafmt v2.3.2 to v3.11.5, introducing significant changes to how source code is formatted. Users will see updates to import handling (selectors are now folded), the removal of semicolons, and specific rules for floating-point literals and docstrings. This change also updates the default dialect to scala212 and excludes specific files like LinesSuite.scala from formatting checks.
(repo-wide) · high confidence
Website footer now links to Discord instead of Gitter
The website footer component has been updated to direct users to the project's Discord community rather than Gitter. This change is visible in the new Footer.js file, which includes a link to the Discord server alongside GitHub and Twitter social badges.
website/core · high confidence
junit-interface moved into MUnit and refactored
The junit-interface library has been moved into the MUnit codebase and reorganized under the munit.internal.junitinterface package. This change includes a major refactoring of the runner and logging infrastructure: the JUnitRunner now uses a switch-based argument parser, buffered logging is enabled by default, and ANSI color support has been improved with correct 'bright' color codes and NO\_COLOR environment variable support. Additionally, the PantsFramework now supports ScalaTest 3.1+ by recognizing the new JUnitRunner package location, and concurrency issues in the runner have been fixed.
junit-interface · high confidence
Test coverage
Added @IgnoreSuite annotation for JVM tests; Added JVM-specific test suites for async fixtures, timeouts, and test selectors; Added JavaScript-specific test suites for async, timeout, and reflective instantiation; Added comprehensive framework integration tests; Added comprehensive test suites for MUnit core features; Added tests for Scala Native reflective instantiation and await behavior; Added tests for issue \#1002 and CPU throttling utility.
Dependencies
Upgrade jsdom to v30 and add website build lockfiles
The project now uses jsdom version 30.0.1 for its JavaScript environment, replacing the previous version. This update is accompanied by the addition of package-lock.json and website/yarn.lock files to manage dependencies for the root project and the Docusaurus-based website, ensuring reproducible builds for the documentation site.
(dependencies) · high confidence
Upgrade to sbt 2.0 and update build toolchain
The build system has been upgraded from sbt 1.3.6 to sbt 2.0.6, requiring updates to several plugins and dependencies to maintain compatibility. Key plugin updates include sbt-ci-release to 1.12.0, sbt-buildinfo to 0.13.1, sbt-mdoc to 2.9.1, sbt-scalafmt to 2.6.2, sbt-scalafix to 0.14.7, sbt-scalajs to 1.22.0, sbt-scala-native to 0.5.12, sbt-mima-plugin to 1.2.0, and sbt-java-formatter to 0.13.1. Additionally, the google-cloud-storage library used in the build has been updated to version 2.71.0.
project · high confidence
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
How this codebase got here
Baseline
- First survey — no prior run to compare against. CAI 64.
Lenses
- Code Health 95
- Architecture 100
- Maturity 45
- Readiness 76
- Security 79
Changes since last survey
- 300 commits — 277 feature/other, 23 fixes
By area
- (repo) — 98 commits
- (root) — 76 commits
- project/plugins.sbt — 25 commits
- junit-interface/src — 16 commits
- project/build.properties — 15 commits
- website/yarn.lock — 13 commits
- .github/workflows — 12 commits
- munit/shared — 9 commits
- munit/js-native — 5 commits
- tests/jvm — 5 commits
- tests/shared — 5 commits
- website/pages — 4 commits
- docs/getting-started.md — 3 commits
- munit/js — 3 commits
- munit/native — 3 commits
- docs/assertions.md — 1 commit
- docs/integrations — 1 commit
- docs/tests.md — 1 commit
- docs/troubleshooting.md — 1 commit
- munit-sbt/src — 1 commit
Notable commits
- fix: Fix compilation, scalafmt and scalafix
- fix: Fix links to images used by the website
- fix: Fix reflective instantiation of suites on Scala 2.13 Scala Native
- fix: Fix spurious failure reported for empty/ignored suites
- fix: Merge pull request #1087 from alejandrohdezma/fix/silent-fixture-enumeration-failure
- fix: Merge pull request #1091 from iamezcua-dev/fix/website-broken-images
- fix: Merge pull request #1094 from Gedochao/bugfix/1093
- fix: Merge pull request #1104 from Gedochao/bugfix/scala-native-with-scala-2.13
- fix: Merge pull request #1115 from damiankus-vl/fix-image-links
- fix: Merge pull request #1126 from OlegYch/fix-compileErrors
- fix: Merge pull request #1135 from tgodzik/fix-release
- fix: Merge pull request #969 from tgodzik/fix-page
- fix: Merge pull request #988 from iRevive/fix/platform-final
- fix: Merge pull request #998 from KacperFKorban/fix-tests-with-parens
- fix: bugfix: Add back FutureCompat to avoid binary compat issues
- fix: bugfix: Fix website release
- fix: chore: Fix missing image
- fix: fix(website): Correct broken image
- fix: fix(website): Correct broken image
- fix: fix(website): Correct broken image
- …and 280 more
Architecture
- 0 containers · 1 bounded contexts · 0 dependency edges (baseline)
Written by watchdog.canine.dev from the codebase's own history, inside the signed delivery this page is composed from.
Survey your own repository
scalameta/munit was measured the same way every project in this corpus was: the same rubric, at a pinned commit, with the result published in full. Point a surveyor at a repository you know and see whether you agree with it.
About this page
- The score is its most recent published measurement, taken on 20 September 2026 at a pinned commit. It is not a live figure and does not change until the project is measured again.
- Measured at commit 65bc103abb97c01057e735bcd2111ce64722fc82 — the exact code this score is about.
- Scored under rubric-2026.09.15 — the same rubric and the same method as every other entry in this index.
- Measured by watchdog.canine.dev using codehealth-analyzer preprod-b51f968c9b10.