Observer Spy

screenshot of Observer Spy
angular

This library makes RxJS Observables testing easy!

Overview

The Observer-Spy library is a game-changer for anyone working with RxJS Observables, especially when it comes to testing. It tackles the common complexities and challenges associated with traditional Marble tests, providing a simplified approach that makes testing observables not only easier but also cleaner. Designed with developers in mind, Observer-Spy allows you to focus on the outcomes of your actions rather than getting tangled in implementation details.

This library is particularly useful for testing advanced use cases of observables where Marble tests can become convoluted and hard to maintain. By introducing a more intuitive system of observer spies, it reduces complexity, making it accessible for developers at all levels.

Features

  • Simplified Testing: Makes RxJS observable testing straightforward, eliminating the confusion that often comes with traditional Marble tests.

  • Auto Unsubscribing: Automatically unsubscribes from observers created with subscribeSpyTo(), freeing you from the hassle of manual unsubscription for each test.

  • Error Handling: Easily spy on errors using receivedError and getError, designed to catch unexpected errors with configurable settings for error expectations.

  • Async/Await Support: Seamlessly integrates with async + await syntax, allowing you to wait for observable completions before evaluating results.

  • Manual Spy Creation: Offers the ability to manually create an ObserverSpy instance for more tailored testing scenarios.

  • Cleaner Test Results: Focus on the values received and their order instead of intricate implementation details, resulting in clearer, more maintainable tests.

  • Testing Synchronization: Provides options for testing synchronous and asynchronous logic, further enhancing its versatility in different testing environments.

angular
Angular

Angular is a TypeScript-based open-source framework by Google for building dynamic single-page applications and cross-platform mobile apps with MVC architecture and a rich set of features.

eslint
Eslint

ESLint is a linter for JavaScript that analyzes code to detect and report on potential problems and errors, as well as enforce consistent code style and best practices, helping developers to write cleaner, more maintainable code.

typescript
Typescript

TypeScript is a superset of JavaScript, providing optional static typing, classes, interfaces, and other features that help developers write more maintainable and scalable code. TypeScript's static typing system can catch errors at compile-time, making it easier to build and maintain large applications.