Description
jest-marbles is a helper library for testing reactive code written with RxJS. It provides helper functions and Jest matchers for marble testing, so tests can describe streams with short marble strings. When a test fails, the error messages are marblized, which makes them easier to read. The library is written in TypeScript. Prerequisites are Jest, RxJS and some familiarity with marble syntax. The README includes a version 4 migration guide. Version 4 runs RxJS's TestScheduler in run mode, with frames of 1 millisecond instead of 10, and time progression syntax replaces the old frameTimeFactor. A new marbleTest helper covers tests that use animate() or operators that rely on RxJS's default scheduler, such as delay, timer, interval and debounceTime. The package is public on GitHub.…
Highlights
- Jest matchers for RxJS marble tests
- Marblized error messages
- TypeScript support
- marbleTest helper for default-scheduler operators
Ratings & Reviews
No ratings yet
Be the first to rate jest-marbles.
People also visit
jest-marbles FAQ
What is jest-marbles?
A set of Jest helpers and matchers for testing RxJS streams with marble diagrams.
What do I need to use it?
Jest, RxJS and familiarity with marble syntax, according to the README prerequisites.
What changed in version 4?
The README says the TestScheduler runs in run mode, frames are 1 ms each, and frameTimeFactor is no longer honored. Durations are written with time progression syntax.
Which helper is for debounceTime or delay?
The new marbleTest helper. The README says it virtualizes RxJS's default schedulers so operators like delay and debounceTime resolve in virtual time.
What are the best jest-marbles alternatives?
Popular alternatives to jest-marbles include jest-preset-angular, @jscutlery/playwright-ct-angular and Early AI. See all jest-marbles alternatives

















