Skip to content

Commit aa89861

Browse files
committed
browserify tests, add test runner html
1 parent e61514b commit aa89861

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

bin/browserify.sh

+6
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@ $browserify_cmd \
1616
--verbose \
1717
&
1818

19+
$browserify_cmd \
20+
test/unit/controller/*.js \
21+
test/unit/service/*.js \
22+
--outfile test/browserified/browserified_tests.js \
23+
&
24+
1925
popd > /dev/null

test/browserified/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
browserified_tests.js

test/browserified/index.html

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!DOCTYPE html>
2+
<html lang="en-us">
3+
<head>
4+
<title>Browserify Tests Demo</title>
5+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
7+
<link rel="stylesheet" href="../../node_modules/mocha/mocha.css" />
8+
</head>
9+
<body>
10+
<div id="mocha"></div>
11+
12+
<!-- load and configure mocha -->
13+
<script src="../../node_modules/mocha/mocha.js"></script>
14+
<script>
15+
'use strict';
16+
mocha.setup('bdd')
17+
mocha.slow(500)
18+
mocha.timeout(3000)
19+
</script>
20+
21+
<!-- load test suite -->
22+
<script src="browserified_tests.js"></script>
23+
24+
<!-- kick of tests -->
25+
<script>
26+
if (window.mochaPhantomJS) {
27+
window.mochaPhantomJS.run()
28+
} else {
29+
mocha.run()
30+
}
31+
</script>
32+
</body>
33+
</html>

0 commit comments

Comments
 (0)