This package has been deprecated

Author message:

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

rx-spy-util
TypeScript icon, indicating that this package has built-in type declarations

1.2.0 • Public • Published

rx-spy-util

Collect all your spies to observable values in one util. SpyUtil helps you keep track on each call without all that boilerplate code

Usage

For extended excamples, see main.spec.ts

const key =  'someKey';
const spyUtil: SpyUtil = new SpyUtil();
// before each
spyUtil.spySubscribe(service.someObservable, key);
spyUtil.spyException(service.someObservable, 'someOtherId');

....
// tests
expect(spyUtil.get(key)).toHaveBeenCalledTimes(1) ...
expect(spyUtil.get('someOtherId')).not.toHaveBeenCalled() ...
expect(spyUtil.allCounts()).toEqual([1, 0]) ...
expect(spyUtil.argsFor(key, 0).toEqual('some string')) ...
expect(spyUtil.lastOf(key).toEqual('some string')) ...
...
// after each
spyUtil.unsubscribe() ...

Test

$> npm i && npm test

Dependencies

Your project should have rxjs,and jasmine installed - these are omitted in the bundle to avoid version conflicts

Todo

karma singleRun=false not working

Package Sidebar

Install

npm i rx-spy-util

Weekly Downloads

2

Version

1.2.0

License

MIT

Unpacked Size

9.53 kB

Total Files

5

Last publish

Collaborators

  • hansogj