add espree comment attachment tests and remove ranges test property from babylon tests

This commit is contained in:
Sebastian McKenzie
2015-07-25 06:07:51 +01:00
parent 006f3db76a
commit bed14e9b42
233 changed files with 3512 additions and 586 deletions

View File

@@ -21,6 +21,7 @@ _.each(fixtures, function (suites, name) {
function runTest(test) {
var opts = test.options;
opts.locations = true;
opts.ranges = true;
try {
var ast = parse(test.actual.code, opts);
@@ -40,7 +41,12 @@ function runTest(test) {
if (opts.throws) {
throw new Error("Expected error message: " + opts.throws + ". But parsing succeeded.");
} else {
var mis = misMatch(JSON.parse(test.expect.code), ast);
try {
var mis = misMatch(JSON.parse(test.expect.code), ast);
} catch (err) {
console.log(test.expect.code);
throw err;
}
if (mis) {
//delete ast.tokens;
//require("fs").writeFileSync(test.expect.loc, JSON.stringify(ast, null, " "));