Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
Better handle error specs
Browse files Browse the repository at this point in the history
  • Loading branch information
xzyfer committed Nov 11, 2015
1 parent 23146ff commit 2fff7c1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion test/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,20 @@ module.exports.getSuites = function() {

tests.forEach(function(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].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].paths = [
testPath,
Expand Down

0 comments on commit 2fff7c1

Please sign in to comment.