build(broccoli): add support for DiffResult#addedPaths

Some plugins want to explicitly know of new paths, so we need to distinguish them from changed paths.
This commit is contained in:
Igor Minar
2015-05-31 17:24:21 -07:00
parent efab03274f
commit dc45559c17
13 changed files with 204 additions and 106 deletions

View File

@ -52,4 +52,26 @@ describe('Flatten', () => {
expect(fs.readdirSync('output')).toEqual(['file-1.1.txt', 'file-2.txt', 'file-3.txt']);
});
it('should throw an exception if duplicates are found', () => {
let testDir = {
'input': {
'dir1': {
'file-1.txt': mockfs.file({content: 'file-1.txt content', mtime: new Date(1000)}),
'subdir-1': {
'file-1.txt': mockfs.file({content: 'file-1.1.txt content', mtime: new Date(1000)})
},
'empty-dir': {}
},
},
'output': {}
};
mockfs(testDir);
let differ = new TreeDiffer('testLabel', 'input');
let flattenedTree = flatten('input');
expect(() => flattenedTree.rebuild(differ.diffTree())).
toThrowError("Duplicate file 'file-1.txt' found in path 'dir1/subdir-1/file-1.txt'");
});
});