1.0.1 • Published 9 years ago

jasmine-promise-helpers v1.0.1

Weekly downloads
1
License
ISC
Repository
github
Last release
9 years ago

Jasmine Promise Helpers

Descriptions

Tiny module to make writing tests with jasmine 1.3 a little easier when using promises (actually, jQuery deferreds).

Installation

npm install --save-dev jasmine-promise-helpers

Using

var P = require('jasmine-promise-helpers');
describe('my test', function() {
	beforeEach(function() {
		spyOn(MyModule, 'myFunction').andCallFake(_(P.resolveDummyPromiseAsync).partial(42));
		spyOn(MyModule, 'myOtherFunction').andCallFake(P.rejectDummyPromiseAsync);
		runsAndWaitsFor(MyModule.testIt);
	});
	it('should call my async function', function() {
		expect(MyModule.myFunction).toHaveBeenCalled();
	});
});