forked from tonyg/js-nacl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrunner.html
46 lines (46 loc) · 1.62 KB
/
runner.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!doctype html>
<html>
<head>
<title>js-nacl in-browser tests</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="../node_modules/mocha/mocha.css">
</head>
<body>
<div id="mocha"></div>
<script src="../node_modules/mocha/mocha.js"></script>
<script>mocha.setup('exports');</script>
<script src="../lib/nacl_factory.js"></script>
<script>
var assert = (function () {
var exports = {};
exports.fail = function (actual, expected, message, operator) {
if (typeof message === "undefined") {
message = "assertion failed: " + actual + " " + operator + " " + expected;
}
throw ({ actual: actual, expected: expected, message: message, operator: operator });
}
exports.equal = function (actual, expected, message) {
if (actual != expected) exports.fail(actual, expected, message, "==");
};
exports.notEqual = function (actual, expected, message) {
if (actual == expected) exports.fail(actual, expected, message, "!=");
};
exports.ok = function (v, m) { exports.equal(v, true, m); };
return exports;
})();
var nacl;
var suite = {};
</script>
<script src="tests.js"></script>
<script>
nacl_factory.instantiate(function (nacl_instance) {
nacl = nacl_instance;
mocha.suite.emit('require', suite);
mocha.run();
}, {
memoryInitializerPrefixURL: '../lib/'
});
</script>
</body>
</html>