2013-08-19 15:13:32 -04:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html style="overflow-y: auto">
|
|
|
|
<head>
|
|
|
|
<meta charset="utf-8">
|
|
|
|
<title>JavaScript Unit Tests</title>
|
2013-10-02 09:47:41 -04:00
|
|
|
<link rel="stylesheet" href="../lib/mocha.css" />
|
2013-08-19 15:13:32 -04:00
|
|
|
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="mocha"></div>
|
2014-10-07 14:32:23 -04:00
|
|
|
|
|
|
|
<script>
|
|
|
|
//
|
|
|
|
// Polyfills
|
|
|
|
//
|
|
|
|
|
|
|
|
(function() {
|
|
|
|
'use strict';
|
|
|
|
// Mozilla bind polyfill because phantomjs is stupid
|
|
|
|
if (!Function.prototype.bind) {
|
|
|
|
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 && oThis ? this : oThis, aArgs.concat(Array.prototype.slice.call(arguments)));
|
|
|
|
};
|
|
|
|
|
|
|
|
FNOP.prototype = this.prototype;
|
|
|
|
fBound.prototype = new FNOP();
|
|
|
|
|
|
|
|
return fBound;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
// a warm round of applause for phantomjs for missing events
|
|
|
|
(function() {
|
|
|
|
function CustomEvent(event, params) {
|
|
|
|
params = params || {
|
|
|
|
bubbles: false,
|
|
|
|
cancelable: false,
|
|
|
|
detail: undefined
|
|
|
|
};
|
|
|
|
var evt = document.createEvent('CustomEvent');
|
|
|
|
evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
|
|
|
|
return evt;
|
|
|
|
}
|
|
|
|
|
|
|
|
CustomEvent.prototype = window.Event.prototype;
|
|
|
|
|
|
|
|
window.CustomEvent = CustomEvent;
|
|
|
|
})();
|
|
|
|
})();
|
|
|
|
</script>
|
2013-08-19 15:13:32 -04:00
|
|
|
|
2013-10-02 09:47:41 -04:00
|
|
|
<script src="../lib/chai.js"></script>
|
|
|
|
<script src="../lib/mocha.js"></script>
|
2014-10-07 14:32:23 -04:00
|
|
|
<script src="../lib/sinon.js"></script>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
window.expect = chai.expect;
|
|
|
|
mocha.setup('bdd');
|
|
|
|
</script>
|
2013-08-19 15:13:32 -04:00
|
|
|
|
2014-10-07 14:32:23 -04:00
|
|
|
<script src="index.js"></script>
|
2013-08-19 15:13:32 -04:00
|
|
|
|
2014-10-07 14:32:23 -04:00
|
|
|
<script>
|
|
|
|
mocha.checkLeaks();
|
|
|
|
mocha.globals([]);
|
|
|
|
mocha.run();
|
|
|
|
</script>
|
2013-08-19 15:13:32 -04:00
|
|
|
</body>
|
|
|
|
</html>
|