Fail tests that have expected.json and throws-option (#285)

* Fail tests that have expected.json and throws

* Remove obsolete test files
This commit is contained in:
Daniel Tschinder
2017-01-12 22:38:41 +01:00
committed by GitHub
parent aa1a4be5ec
commit 13bebfdf45
199 changed files with 5 additions and 34058 deletions

View File

@@ -13,7 +13,7 @@ module.exports = function runFixtureTests(fixturesPath, parseFunction) {
try {
return runTest(task, parseFunction);
} catch (err) {
err.message = task.actual.loc + ": " + err.message;
err.message = name + "/" + task.actual.filename + ": " + err.message;
throw err;
}
});
@@ -33,6 +33,10 @@ function runTest(test, parseFunction) {
opts.locations = true;
opts.ranges = true;
if (opts.throws && test.expect.code) {
throw new Error("File expected.json exists although options specify throws. Remove expected.json.");
}
try {
var ast = parseFunction(test.actual.code, opts);
} catch (err) {