-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrequirejs.html
47 lines (42 loc) · 1.28 KB
/
requirejs.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
47
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Mocha Webdriver Tests</title>
<link href="../../node_modules/mocha/mocha.css" rel="stylesheet">
</head>
<body>
<div id="mocha"></div>
<script src="https://unpkg.com/requirejs/require.js"></script>
<script>
/*
* Example how tun run tests under require.js.
*
* Just to show how to resolve dependencies and to check that our
* `dist/mocha-webdriver-client` works as UMD module.
*/
require.config({
shim: {
"mocha": {
exports: 'Mocha'
},
"tests.js": {
deps: ["bootstrap-mocha", "chai"]
}
},
paths: {
"mocha": ["../../node_modules/mocha/mocha"],
"chai": "../../node_modules/chai/chai",
"mocha-webdriver-client": "../../dist/mocha-webdriver-client"
}
});
define("bootstrap-mocha", ["mocha", "mocha-webdriver-client"], function (_, MochaWebdriverClient) {
mocha.setup({ ui: "bdd" });
});
require(["tests.js"], function() {
mocha.checkLeaks();
mocha.run();
});
</script>
</body>
</html>