Commit d10f348e by Kevin Mårtensson

Merge pull request #533 from kevva/test-clean

Cleanup tests
parents 33fb8aa4 65234da8
...@@ -182,28 +182,25 @@ describe('api', function() { ...@@ -182,28 +182,25 @@ describe('api', function() {
}); });
}); });
it('should contain an array of all included files in stats when data is passed', function(done) { it('should contain all included files in stats when data is passed', function(done) {
var src = fixture('include-files/index.scss');
var stats = {}; var stats = {};
var expected = [
fixture('include-files/bar.scss').replace(/\\/g, '/'),
fixture('include-files/foo.scss').replace(/\\/g, '/'),
'stdin'
];
sass.render({ sass.render({
data: read(fixture('include-files/index.scss'), 'utf8'), data: read(src, 'utf8'),
includePaths: [fixture('include-files')], includePaths: [fixture('include-files')],
stats: stats, stats: stats,
success: function() { success: function() {
['foo', 'bar'].map(function(expect) { assert.deepEqual(stats.includedFiles, expected);
var slug = fixture('include-files/' + expect + '.scss').replace(/\\/g, '/');
assert(stats.includedFiles.some(function(s) {
return s === slug;
}));
});
done();
},
error: function(err) {
assert(!err);
done(); done();
} }
}); });
}); });
}); });
describe('.renderSync(options)', function() { describe('.renderSync(options)', function() {
...@@ -379,9 +376,7 @@ describe('api', function() { ...@@ -379,9 +376,7 @@ describe('api', function() {
fixture('include-files/index.scss').replace(/\\/g, '/') fixture('include-files/index.scss').replace(/\\/g, '/')
]; ];
assert.equal(stats.includedFiles[0], expected[0]); assert.deepEqual(stats.includedFiles, expected);
assert.equal(stats.includedFiles[1], expected[1]);
assert.equal(stats.includedFiles[2], expected[2]);
done(); done();
}); });
...@@ -435,10 +430,6 @@ describe('api', function() { ...@@ -435,10 +430,6 @@ describe('api', function() {
}); });
}); });
describe('.renderSync({stats: {}})', function() { describe('.renderSync({stats: {}})', function() {
var start = Date.now(); var start = Date.now();
var stats = {}; var stats = {};
......
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