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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user