Skip to content

Commit c8ec0c9

Browse files
committed
fixed global xhr issue
1 parent e5859c6 commit c8ec0c9

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

packages/optimizely-sdk/lib/index.browser.tests.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ describe('javascript-sdk', function() {
5353
});
5454
sinon.spy(console, 'error');
5555
sinon.stub(configValidator, 'validate');
56-
5756
xhr = sinon.useFakeXMLHttpRequest();
57+
global.XMLHttpRequest = xhr;
5858
requests = [];
5959
xhr.onCreate = function(req) {
6060
requests.push(req);

packages/optimizely-sdk/lib/index.browser.umdtests.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ describe('javascript-sdk', function() {
4242
sinon.stub(Optimizely.prototype, 'close');
4343

4444
xhr = sinon.useFakeXMLHttpRequest();
45+
global.XMLHttpRequest = xhr;
4546
requests = [];
4647
xhr.onCreate = function(req) {
4748
requests.push(req);

0 commit comments

Comments
 (0)