46 lines
1.1 KiB
HTML
46 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>OpenPGPJS Unit Tests</title>
|
|
<link rel="stylesheet" href="lib/mocha.css" />
|
|
|
|
</head>
|
|
<body>
|
|
<div id="mocha"></div>
|
|
|
|
<!-- libs -->
|
|
<script src="../dist/openpgp.js"></script>
|
|
<script src="lib/mocha.js"></script>
|
|
<script>
|
|
mocha.setup('bdd');
|
|
mocha.timeout(240000);
|
|
</script>
|
|
<script src="lib/unittests-bundle.js"></script>
|
|
<script>
|
|
var runner = mocha.run();
|
|
|
|
var failedTests = [];
|
|
runner.on('end', function(){
|
|
window.mochaResults = runner.stats;
|
|
window.mochaResults.reports = failedTests;
|
|
});
|
|
|
|
function logFailure(test, err) {
|
|
var flattenTitles = function(test) {
|
|
var titles = [];
|
|
while (test.parent.title) {
|
|
titles.push(test.parent.title);
|
|
test = test.parent;
|
|
}
|
|
return titles.reverse();
|
|
};
|
|
|
|
failedTests.push({name: test.title, result: false, message: err.message, stack: err.stack, titles: flattenTitles(test)});
|
|
};
|
|
|
|
runner.on('fail', logFailure);
|
|
</script>
|
|
</body>
|
|
</html>
|