Commit 96f0bfb5 by Andrew Nesbitt

Merge pull request #457 from edds/update-test-runner

Update test runner to match sass-spec
parents b75da700 4f5ac736
...@@ -30,7 +30,7 @@ describe('sass-spec', function() { ...@@ -30,7 +30,7 @@ describe('sass-spec', function() {
if (sassSpecDirExists) { if (sassSpecDirExists) {
var suitesPath = path.join(sassSpecPath, 'spec'); var suitesPath = path.join(sassSpecPath, 'spec');
var suites = fs.readdirSync(suitesPath); var suites = fs.readdirSync(suitesPath);
var ignoreSuites = ['todo', 'benchmarks']; var ignoreSuites = ['libsass-todo-issues', 'libsass-todo-tests'];
suites.forEach(function(suite) { suites.forEach(function(suite) {
if (ignoreSuites.indexOf(suite) !== -1) { if (ignoreSuites.indexOf(suite) !== -1) {
...@@ -43,22 +43,27 @@ describe('sass-spec', function() { ...@@ -43,22 +43,27 @@ describe('sass-spec', function() {
tests.forEach(function(test) { tests.forEach(function(test) {
var testPath = path.join(suitePath, test); var testPath = path.join(suitePath, test);
var inputFilePath = path.join(testPath, 'input.scss');
it(test, function(done) { if (fs.existsSync(inputFilePath)) {
sass.render({ it(test, function(done) {
file: path.join(testPath, 'input.scss'), sass.render({
includePaths: [testPath, path.join(testPath, 'sub')], file: inputFilePath,
success: function(css) { includePaths: [testPath, path.join(testPath, 'sub')],
var expected = fs.readFileSync(path.join(testPath, 'expected_output.css'), 'utf-8'); success: function(css) {
var expected = fs.readFileSync(path.join(testPath, 'expected_output.css'), 'utf-8');
assert.equal(normalize(css), normalize(expected)); assert.equal(normalize(css), normalize(expected));
done(); done();
}, },
error: function(error) { error: function(error) {
done(new Error(error)); done(new Error(error));
} }
});
}); });
}); } else {
it(test);
}
}); });
}); });
}); });
......
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