Skip to content

Commit

Permalink
Added test for case with order of entities
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewblond committed Apr 20, 2015
1 parent a5c983d commit cd4931d
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions test/techs/files.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,51 @@ describe('techs', function () {
.then(done, done);
});

it('must keep order of entities', function (done) {
mockFs({
blocks: {
'block-1': {
'block-1.ext-1': '',
'block-1.ext-2': ''
},
'block-2': {
'block-2.ext-1': '',
'block-2.ext-2': ''
}
},
bundle: {}
});

var bundle = new TestNode('bundle'),
deps = [
{ block: 'block-1' },
{ block: 'block-2' }
],
files = [
'block-1.ext-1',
'block-1.ext-2',
'block-2.ext-1',
'block-2.ext-2'
];

bundle.runTech(levelsTech, { levels: ['blocks'] })
.then(function (levels) {
bundle.provideTechData('?.levels', levels);
bundle.provideTechData('?.deps.js', deps);

return bundle.runTechAndGetResults(filesTech);
})
.then(function (result) {
var FileList = result['bundle.files'],
filenames = FileList.getBySuffix(['ext-1', 'ext-2']).map(function (fileInfo) {
return fileInfo.name;
});

filenames.must.eql(files);
})
.then(done, done);
});

it('must get block file by deps', function (done) {
var scheme = {
blocks: {
Expand Down

0 comments on commit cd4931d

Please sign in to comment.