Add some basic testing using jasmine

Summary:
Make some tests that test the parser. So far, there are no DOM tests,
but maybe later.

Test Plan:
Run `make serve` and then visit `/test/test.html`. Make sure all the
tests pass.

Reviewers: alpert

Reviewed By: alpert

Differential Revision: http://phabricator.khanacademy.org/D2987
This commit is contained in:
Emily Eisenberg
2013-07-11 18:32:44 -07:00
parent adb8b5d671
commit 507a552ffd
9 changed files with 3765 additions and 8 deletions

View File

@@ -25,7 +25,24 @@ app.get("/katex.js", function(req, res, next) {
});
});
app.get("/test/katex-tests.js", function(req, res, next) {
var b = browserify();
b.add("./test/katex-tests");
b.transform(jisonify);
var stream = b.bundle({});
var body = "";
stream.on("data", function(s) { body += s; });
stream.on("error", function(e) { next(e); });
stream.on("end", function() {
res.setHeader("Content-Type", "text/javascript");
res.send(body);
});
});
app.use(express.static(path.join(__dirname, "static")));
app.use("/test", express.static(path.join(__dirname, "test")));
app.use(function(err, req, res, next) {
console.error(err.stack);