Make tests runnable under node

This commit is contained in:
Marijn Haverbeke
2012-09-24 11:50:03 +02:00
parent 587c790f7b
commit 03d95cda2c
3 changed files with 74 additions and 52 deletions

View File

@@ -1,6 +1,11 @@
// Tests largely based on those of Esprima
// (http://esprima.org/test/)
if (typeof exports != "undefined") {
var test = require("./driver.js").test;
var testFail = require("./driver.js").testFail;
}
test("this\n", {
type: "Program",
start: {