Narcissistic Passion Minified

    jasmine-spy

    0.0.2 • Public • Published

    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.

    Install

    npm i jasmine-spy

    DownloadsWeekly Downloads

    2

    Version

    0.0.2

    License

    MIT

    Last publish

    Collaborators

    • c3s4r
    • devsu