DEV Community

Cover image for Jasmine Marbles now supports RxJS 6/7 with jest-circus
Brandon Roberts
Brandon Roberts

Posted on

Jasmine Marbles now supports RxJS 6/7 with jest-circus

Photo by Sharon McCutcheon on Unsplash

Jasmine marbles is a set of RxJS marble testing helpers for writing tests with Jasmine or Jest.

Jest version 27 was recently released, which introduces a completely new default test runner named jest-circus. The previous jest-jasmine2 test runner contained many jasmine-specific APIs that are not in jest-circus.

With the release of version jasmine-marbles 0.8.3, both test runners are supported with RxJS 6.x. RxJS 7.x is supported in versions 0.9.0 and later, but the majority of users are on RxJS 6.x, which is what the latest major releases of Angular, Nx, NgRx, and many other libraries use.

To install the latest version:

npm install jasmine-marbles@latest --save-dev
Enter fullscreen mode Exit fullscreen mode

or

yarn install jasmine-marbles@latest --dev
Enter fullscreen mode Exit fullscreen mode

If you need to revert back to the previous test runner, set the testRunner in your jest.config.js to jest-jasmine2.

To learn more about testing RxJS using marble diagrams in general, check out the marble testing guide in the RxJS docs.

If you've found jasmine-marbles useful ❤️, please consider sponsoring me on GitHub as a monthly or one-time sponsor.

You can also follow me on Twitter, subscribe on YouTube, and join me for live streams on Twitch.

Discussion (0)