Skip to content

Commit

Permalink
includedFiles returns an array in no particular order
Browse files Browse the repository at this point in the history
Fixes: sass#1123
  • Loading branch information
saper committed Sep 7, 2015
1 parent e95b5eb commit 4ed8bde
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions test/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ var assert = require('assert'),
read = fs.readFileSync,
sass = process.env.NODESASS_COV ? require('../lib-cov') : require('../lib'),
fixture = path.join.bind(null, __dirname, 'fixtures'),
resolveFixture = path.resolve.bind(null, __dirname, 'fixtures');
resolveFixture = path.resolve.bind(null, __dirname, 'fixtures'),
LIBSASS_VERSION = null;

describe('api', function() {

describe('.render(options, callback)', function() {
it('should compile sass to css with file', function(done) {
var expected = read(fixture('simple/expected.css'), 'utf8').trim();
Expand Down Expand Up @@ -980,7 +982,7 @@ describe('api', function() {
file: fixture('include-files/index.scss')
}, function(error, result) {
assert(!error);
assert.deepEqual(result.stats.includedFiles, expected);
assert.deepEqual(result.stats.includedFiles.sort(), expected.sort());
done();
});
});
Expand Down Expand Up @@ -1441,11 +1443,12 @@ describe('api', function() {
fixture('include-files/bar.scss').replace(/\\/g, '/'),
fixture('include-files/foo.scss').replace(/\\/g, '/'),
fixture('include-files/index.scss').replace(/\\/g, '/')
];
].sort();
var actual = result.stats.includedFiles.sort();

assert.equal(result.stats.includedFiles[0], expected[0]);
assert.equal(result.stats.includedFiles[1], expected[1]);
assert.equal(result.stats.includedFiles[2], expected[2]);
assert.equal(actual[0], expected[0]);
assert.equal(actual[1], expected[1]);
assert.equal(actual[2], expected[2]);
done();
});

Expand Down

0 comments on commit 4ed8bde

Please sign in to comment.