Cleanup spy promise strategies to be more consistent with Jasmine at large
- Rename `resolveWith` to `resolveTo` to match `toBeResolvedTo` - No longer wrap non-Errors in `rejectWith` - Fixes #1715
This commit is contained in:
@@ -208,7 +208,7 @@ describe('Spies', function() {
|
||||
it('works with global Promise library when available', function(done) {
|
||||
jasmine.getEnv().requirePromises();
|
||||
|
||||
var spy = env.createSpy('foo').and.resolveWith(42);
|
||||
var spy = env.createSpy('foo').and.resolveTo(42);
|
||||
spy()
|
||||
.then(function(result) {
|
||||
expect(result).toEqual(42);
|
||||
@@ -225,7 +225,7 @@ describe('Spies', function() {
|
||||
customPromise.resolve.and.returnValue('resolved');
|
||||
env.configure({ Promise: customPromise });
|
||||
|
||||
var spy = env.createSpy('foo').and.resolveWith(42);
|
||||
var spy = env.createSpy('foo').and.resolveTo(42);
|
||||
expect(spy()).toEqual('resolved');
|
||||
expect(customPromise.resolve).toHaveBeenCalledWith(42);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user