Keep all Promise implementation details internal

This commit is contained in:
Elliot Nelson
2019-05-08 09:07:01 -04:00
parent 95e1890e64
commit 4731b4ee4d
9 changed files with 107 additions and 102 deletions

View File

@@ -27,19 +27,4 @@ describe('base helpers', function() {
}, 100);
});
});
describe('getPromise', function() {
it('returns a custom library if configured', function() {
var myLibrary = { resolve: jasmine.createSpy(), reject: jasmine.createSpy() };
jasmineUnderTest.getEnv().configure({ promiseLibrary: myLibrary });
expect(jasmineUnderTest.getPromise()).toBe(myLibrary);
});
it('returns global library if not configured', function() {
var globalLibrary = {};
var global = { Promise: globalLibrary };
spyOn(jasmineUnderTest, 'getGlobal').and.returnValue(global);
expect(jasmineUnderTest.getPromise()).toBe(globalLibrary);
});
});
});