Permalink
Browse files

In-browser and ex-browser testing. Fixes #17

  • Loading branch information...
1 parent 8081920 commit 4b962c804b69654c3b6aad541717b498d98c2020 @tmcw tmcw committed Dec 17, 2012
View
@@ -2,6 +2,6 @@ docs:
docco src/*.js
test:
- mocha -R spec
+ mocha -R spec test/spec/*.js
.PHONY: docs test
View
@@ -9,11 +9,12 @@
},
"dependencies": {},
"devDependencies": {
- "mocha": "1.2.x"
+ "mocha": "1.2.x",
+ "chai": "1.4.x"
},
"optionalDependencies": {},
"scripts": {
- "test": "mocha -R spec"
+ "test": "mocha -R spec test/spec"
},
"main": "src/simple_statistics.js",
"engines": {
View
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <meta charset='utf-8'>
+ <title>Mocha Tests</title>
+ <link rel="stylesheet" href="lib/mocha.css">
+</head>
+<body>
+ <div id="mocha"></div>
+
+ <script src="lib/mocha.js"></script>
+ <script src="lib/chai.js"></script>
+
+ <script src="../src/simple_statistics.js"></script>
+
+ <script>
+ mocha.setup('bdd');
+ var expect = chai.expect;
+ function require(x) {
+ if (x == '../../') return ss;
+ if (x == 'chai') return { assert: chai.assert };
+ }
+ </script>
+
+ <script src="spec/bayes.test.js"></script>
+ <script src="spec/geometric_mean.test.js"></script>
+ <script src="spec/linear_regression.test.js"></script>
+ <script src="spec/mean.test.js"></script>
+ <script src="spec/mode.test.js"></script>
+ <script src="spec/minmax.test.js"></script>
+ <script src="spec/median.test.js"></script>
+ <script src="spec/quantile.test.js"></script>
+ <script src="spec/r_squared.test.js"></script>
+ <script src="spec/standard_deviation.test.js"></script>
+ <script src="spec/sum.test.js"></script>
+ <script src="spec/t_test.test.js"></script>
+ <script src="spec/variance.test.js"></script>
+
+ <script>
+ (window.mochaPhantomJS || window.mocha).run();
+ </script>
+</body>
+</html>
+
Oops, something went wrong.

0 comments on commit 4b962c8

Please sign in to comment.