Deprecated the Promise config setting
4.0 will only support environments that have native promises, so there will no longer be a need for a user-supplied promise library
This commit is contained in:
@@ -399,11 +399,17 @@ describe('Env', function() {
|
||||
});
|
||||
|
||||
it('can be configured with a custom library', function() {
|
||||
spyOn(env, 'deprecated');
|
||||
var myLibrary = {
|
||||
resolve: jasmine.createSpy(),
|
||||
reject: jasmine.createSpy()
|
||||
};
|
||||
env.configure({ Promise: myLibrary });
|
||||
expect(env.deprecated).toHaveBeenCalledWith(
|
||||
'The `Promise` config property is deprecated. Future versions of ' +
|
||||
'Jasmine will create native promises even if the `Promise` config ' +
|
||||
'property is set. Please remove it.'
|
||||
);
|
||||
});
|
||||
|
||||
it('cannot be configured with an invalid promise library', function() {
|
||||
|
||||
@@ -271,6 +271,7 @@ describe('Spies', function() {
|
||||
reject: jasmine.createSpy()
|
||||
};
|
||||
customPromise.resolve.and.returnValue('resolved');
|
||||
spyOn(env, 'deprecated');
|
||||
env.configure({ Promise: customPromise });
|
||||
|
||||
var spy = env.createSpy('foo').and.resolveTo(42);
|
||||
|
||||
Reference in New Issue
Block a user