2
0
mirror of synced 2025-02-24 12:08:10 +00:00

Removed shims from PhantomJS tests.

This commit is contained in:
Richard Moore 2017-11-09 03:14:48 -05:00
parent a9bc2b5ea8
commit 4df288e244
No known key found for this signature in database
GPG Key ID: 525F70A6FCABC295

View File

@ -11,6 +11,7 @@
<body>
<div id="mocha"></div>
<script src="../node_modules/mocha/mocha.js"></script>
<!--
Shim for PhantomJS: Promise
See: https://github.com/stefanpenner/es6-promise
@ -19,19 +20,9 @@
<!--
Shim for PhantomJS:
- Type Array prototype.slice
- ArrayBuffer.isView
- Number.MAX_SAFE_INTEGER
- Math.log10
-->
<script type="text/javascript">
if (!Uint8Array.prototype.slice) {
Uint8Array.prototype.slice = function() {
var args = Array.prototype.slice.call(arguments);
return new Uint8Array(Array.prototype.slice.apply(this, args));
}
}
if (!ArrayBuffer.isView) {
ArrayBuffer.isView = function(obj) {
// @TODO: This should probably check various instanceof aswell
@ -39,16 +30,6 @@
}
}
if (!Number.MAX_SAFE_INTEGER) {
Number.MAX_SAFE_INTEGER = 0x1fffffffffffff;
}
if (!Math.log10) {
Math.log10 = Math.log10 || function(x) {
return Math.log(x) / Math.LN10;
};
}
// https://github.com/nathanboktae/mocha-phantomjs-core#usage
if (typeof(initMochaPhantomJS) === 'function') {
initMochaPhantomJS();
@ -63,6 +44,7 @@
<!-- Run the test cases! -->
<script type="text/javascript">
//mocha.grep(new RegExp('...')).run();
mocha.run();
</script>
</body>