npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

rx-jasmine-testscheduler-injector

v0.1.1

Published

injects the TestScheduler of RxJs 4 (and lower) via Jasmine spies into time related Observable instance methods.

Readme

Rx-TestScheduler-Injector

Rx-TestScheduler-Injector injects your Rx.TestScheduler into time related Rx.Observable operations using Jasmine spies.

Installation

You can use npm or Bower:

npm

npm install rx-testscheduler-injector --save-dev

Bower

bower install rxjs-testscheduler-injector --save-dev

Usage

To inject your test scheduler to all operators use:

// Do this when you use npm
const RxJsTestSchedulerInjector = require('rx-testscheduler-injector');

// This then works for npm and Bower
RxJsTestSchedulerInjector.inject(yourTestScheduler);

With this you inject your scheduler to the following chainable operations:

  • debounce
  • throttle
  • delay
  • timeout
  • sample

And also inject the test scheduler into these Rx.Observable operations:

  • Rx.Observable.interval
  • Rx.Observable.timer

This function returns an Object containing the created spies. If you want to access the spy for the debounce operator, use:

var rxjsSpies = RxJsTestSchedulerInjector.inject(yourTestScheduler);
var debounceSpy = rxjsSpies.debounce;
expect(debounceSpy).toHaveBeenCalledWith(200);

Handling exceptions

The inject() method also has the ability to exclude some methods when injecting the TestScheduler:

RxJsTestSchedulerInjector.inject(yourTestScheduler, ['debouce', 'inverval', 'delay']);

The exceptions always have to be passed as an array of method names (look for possible methods in the lists above).

Injecting to specific operators

Besides the inject method to inject to all operators there is the possibility to just inject to a single one using

RxJsTestSchedulerInjector.injectInto(operatorName, testScheduler);

with the name of the operator (as a String) and the test scheduler index.

This function returns the spy that injects the operator.