fix handling of no errors from error handling tests - closes #210

master-undefined-tagcontent
Dane Springmeyer 12 years ago
parent a21a195f1b
commit 8ef4efbe39

@ -19,13 +19,17 @@ helper.files('errorhandling', 'mml', function(file) {
local_data_dir: path.join(__dirname, 'rendering'),
filename: file
}).render(mml, function (err) {
var result = helper.resultFile(file);
var output = err.message;
// @TODO for some reason, fs.readFile includes an additional \n
// at the end of read files. Determine why.
fs.readFile(helper.resultFile(file), 'utf8', function(err, data) {
if (!err) assert.deepEqual(output, data.substr(0, data.length - 1));
});
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
// at the end of read files. Determine why.
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…
Cancel
Save