0.0.2 • Published 7 years ago

jasmine-spy v0.0.2

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

jasmine-spy

Helper that works as a shortcut to create jasmine spies that return values or promises

Installation

npm i --save-dev jasmine
npm i --save-dev jasmine-spy

Usage

const Spy = require('jasmine-spy');

describe('your test', () => {
  let myStub;
  beforeEach(() => {
    myStub = {
      'doSomething': Spy.create(),
      'doSomethingElse': Spy.returnValue('a'),
      'anotherMethod': Spy.resolve('the result'),
      'yetAnotherMethod': Spy.reject('some error'),
      'oneMore': Spy.returnValues('a', 'b', 'c'),
      'another': Spy.throwError('something went wrong'),
    };
  });
});

Credits and License

Developed by Devsu. Copyright 2017.

MIT license.