Commit 4960fdbf by xzyfer

Better handle error specs

parent 971f4044
...@@ -39,10 +39,20 @@ module.exports.getSuites = function() { ...@@ -39,10 +39,20 @@ module.exports.getSuites = function() {
tests.forEach(function(test) { tests.forEach(function(test) {
var testPath = join(suitePath, test); var testPath = join(suitePath, test);
var hasErrorFile = fs.existsSync(join(testPath, 'error'));
var hasError = false;
if (hasErrorFile) {
var errorFileContents = fs.readFileSync(join(testPath, 'error')).toString();
hasError = !(
errorFileContents.match(/^DEPRECATION WARNING/) ||
errorFileContents.match(/^WARNING:/) ||
errorFileContents.match(/^.*?\/input.scss:\d+ DEBUG:/)
);
}
ret[suite][test] = {}; ret[suite][test] = {};
ret[suite][test].src = join(testPath, 'input.scss'); ret[suite][test].src = join(testPath, 'input.scss');
ret[suite][test].error = fs.existsSync(join(testPath, 'error')); ret[suite][test].error = hasErrorFile && hasError;
ret[suite][test].expected = join(testPath, 'expected_output.css'); ret[suite][test].expected = join(testPath, 'expected_output.css');
ret[suite][test].paths = [ ret[suite][test].paths = [
testPath, testPath,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment