Removed support for custom promise libraries

All supported platforms now provide promises, so there's no longer a need
for Jasmine to be able to create them via a user-provided library. Jasmine
can still consume non-native promises but will always use the built-in
Promise object to create promises.

[#179078103]
This commit is contained in:
Steve Gravrock
2021-08-30 19:07:26 -07:00
parent 37b9f8e420
commit d61800c5c8
8 changed files with 22 additions and 237 deletions

View File

@@ -248,7 +248,7 @@ describe('Spies', function() {
});
describe('any promise-based strategy', function() {
it('works with global Promise library when available', function(done) {
it('works with global Promise library', function(done) {
var spy = env.createSpy('foo').and.resolveTo(42);
spy()
.then(function(result) {
@@ -257,20 +257,6 @@ describe('Spies', function() {
})
.catch(done.fail);
});
it('works with a custom Promise library', function() {
var customPromise = {
resolve: jasmine.createSpy(),
reject: jasmine.createSpy()
};
customPromise.resolve.and.returnValue('resolved');
spyOn(env, 'deprecated');
env.configure({ Promise: customPromise });
var spy = env.createSpy('foo').and.resolveTo(42);
expect(spy()).toEqual('resolved');
expect(customPromise.resolve).toHaveBeenCalledWith(42);
});
});
describe('when withArgs is used without a base strategy', function() {