mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-14 13:18:15 +02:00
Add workaround for missing ArrayBuffer.isView in PhantomJS
(closes #7072)
This commit is contained in:
+2
-2
@@ -28,9 +28,9 @@
|
||||
"imagery": "node data/update_imagery",
|
||||
"lint": "eslint *.js test/spec modules",
|
||||
"start": "node --max-old-space-size=4096 server.js",
|
||||
"phantom": "phantomjs --web-security=no node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js test/phantom.html spec",
|
||||
"test": "npm-run-all -s lint build test:**",
|
||||
"test:phantom": "phantomjs --web-security=no node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js test/index.html spec",
|
||||
"test:phantom": "phantomjs --web-security=no node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js test/phantom.html spec",
|
||||
"test:iD": "phantomjs --web-security=no node_modules/mocha-phantomjs-core/mocha-phantomjs-core.js test/index.html spec",
|
||||
"translations": "node data/update_locales"
|
||||
},
|
||||
"dependencies": {
|
||||
|
||||
@@ -4,4 +4,7 @@ describe('test some capabilities of PhantomJS', function () {
|
||||
var result = Array.from(s);
|
||||
expect(result).to.eql([1]);
|
||||
});
|
||||
it('has ArrayBuffer.isView', function () {
|
||||
expect(typeof ArrayBuffer.isView).to.eql('function');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -52,6 +52,11 @@ Array.from = function(what) {
|
||||
}
|
||||
};
|
||||
|
||||
// Workaround for `ArrayBuffer.isView` in PhantomJS
|
||||
// https://github.com/openstreetmap/iD/issues/7072
|
||||
if (typeof ArrayBuffer.isView === 'undefined') {
|
||||
ArrayBuffer.isView = function() { return false; };
|
||||
}
|
||||
|
||||
// Add support for sinon-stubbing `fetch` API
|
||||
// (sinon fakeServer works only on `XMLHttpRequest`)
|
||||
|
||||
Reference in New Issue
Block a user