fix handling of no errors from error handling tests - closes #210
This commit is contained in:
parent
a21a195f1b
commit
8ef4efbe39
@ -19,6 +19,9 @@ helper.files('errorhandling', 'mml', function(file) {
|
||||
local_data_dir: path.join(__dirname, 'rendering'),
|
||||
filename: file
|
||||
}).render(mml, function (err) {
|
||||
if (!err) {
|
||||
console.warn("*** <--- WARNING invalid error handling test found (" + file + "): all error handling tests should throw errors!");
|
||||
} else {
|
||||
var result = helper.resultFile(file);
|
||||
var output = err.message;
|
||||
// @TODO for some reason, fs.readFile includes an additional \n
|
||||
@ -26,6 +29,7 @@ helper.files('errorhandling', 'mml', function(file) {
|
||||
fs.readFile(helper.resultFile(file), 'utf8', function(err, data) {
|
||||
if (!err) assert.deepEqual(output, data.substr(0, data.length - 1));
|
||||
});
|
||||
}
|
||||
});
|
||||
} catch(err) {
|
||||
var result = helper.resultFile(file);
|
||||
|
Loading…
Reference in New Issue
Block a user