mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-11-19 11:45:49 +00:00
62 lines
2.1 KiB
HTML
62 lines
2.1 KiB
HTML
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<!-- encoding must be set for mocha's special characters to render properly -->
|
|
<link rel="stylesheet" href="../node_modules/mocha/mocha.css" />
|
|
<script src="http://cdnjs.cloudflare.com/ajax/libs/lodash.js/3.10.1/lodash.min.js"></script>
|
|
</head>
|
|
<body>
|
|
<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="../test-compiled-for-web/ripple-for-web-tests.js"></script>
|
|
<script>
|
|
if (window.initMochaPhantomJS) {
|
|
window.initMochaPhantomJS();
|
|
}
|
|
mocha.ui('bdd')
|
|
</script>
|
|
|
|
<script src="../test-compiled-for-web/integration/integration-test.js"></script>
|
|
|
|
<script>
|
|
mocha.run()
|
|
</script>
|
|
</body>
|
|
</html>
|