Skip to content

Commit 23706f0

Browse files
committed
chore(test-helper): setup promise polyfill for browser testing
relates to ReactiveX#998
1 parent 9bd7649 commit 23706f0

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@
9696
"commitizen": "2.4.4",
9797
"coveralls": "2.11.4",
9898
"cz-conventional-changelog": "1.1.4",
99+
"es6-promise": "^3.0.2",
99100
"esdoc": "0.4.3",
100101
"eslint": "1.5.1",
101102
"fs-extra": "0.24.0",

spec/helpers/test-helper.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ afterEach(function () {
135135
});
136136

137137
global.__root__ = root;
138+
139+
//setup promise polyfill for browsers does not supports it
140+
if (!(root.Promise || root.Rx && root.Rx.config && root.Rx.config.Promise)) {
141+
Rx.config = {
142+
Promise: require('es6-promise').Promise
143+
};
144+
}
138145
})();
139146

140147
global.lowerCaseO = function lowerCaseO() {

0 commit comments

Comments
 (0)