electron/spec/index.html
2013-07-31 10:55:47 +08:00

43 lines
952 B
HTML

<html>
<head>
<link href="../node_modules/mocha/mocha.css" rel="stylesheet">
</head>
<body>
<div id="mocha"></div>
<script type="text/javascript" charset="utf-8">
(function() {
// Show DevTools.
document.oncontextmenu = function(e) {
require('remote').getCurrentWindow().inspectElement(e.clientX, e.clientY);
}
require('coffee-script'); // Supports .coffee tests.
var Mocha = require('mocha');
var mocha = new Mocha();
mocha.ui('bdd').reporter('html');
var query = Mocha.utils.parseQuery(window.location.search || '');
if (query.grep) mocha.grep(query.grep);
if (query.invert) mocha.invert();
// Read all test files.
var walker = require('walkdir').walk(__dirname);
walker.on('file', function(file) {
if (/.coffee$/.test(file))
mocha.addFile(file);
});
walker.on('end', function() {
mocha.run(function() {
Mocha.utils.highlightTags('code');
});
});
})();
</script>
</body>
</html>