jasmine-spy
v0.0.2
Published
Helper that works as a shortcut to create jasmine spies that return values or promises
Downloads
56
Readme
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.