fixes for minified version test minified version in SauceLabs

This commit is contained in:
Ivan Tivonenko
2016-02-06 05:15:56 +02:00
parent 66b07623b0
commit 8767fc0068
10 changed files with 108 additions and 85 deletions

View File

@@ -9,41 +9,7 @@
<div id="deb"></div>
<div id="mocha"></div>
<script src="../node_modules/mocha/mocha.js"></script>
<script>
(function() {
var phantomTest = /PhantomJS/;
if (phantomTest.test(navigator.userAgent)) {
// mocha-phantomjs-core has wrong shim for Function.bind, so we
// will replace it with correct one
// this bind polyfill copied from MDN documentation
Function.prototype.bind = function(oThis) {
if (typeof this !== 'function') {
// closest thing possible to the ECMAScript 5
// internal IsCallable function
throw new TypeError('Function.prototype.bind - what is trying to be bound is not callable');
}
var aArgs = Array.prototype.slice.call(arguments, 1),
fToBind = this,
fNOP = function() {},
fBound = function() {
return fToBind.apply(this instanceof fNOP
? this
: oThis,
aArgs.concat(Array.prototype.slice.call(arguments)));
};
if (this.prototype) {
// native functions don't have a prototype
fNOP.prototype = this.prototype;
}
fBound.prototype = new fNOP();
return fBound;
};
}
})();
</script>
<script src="hacks/phantomhacks.js"></script>
<script src="../build/ripple-latest.js"></script>
<script>
if (window.initMochaPhantomJS) {