mirror of
https://github.com/Smaug123/KaTeX
synced 2025-10-07 04:08:43 +00:00
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:
17
server.js
17
server.js
@@ -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);
|
||||
|
Reference in New Issue
Block a user