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:
@ -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'");
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user