mirror of
https://github.com/wassname/generator-react-webpack.git
synced 2026-09-09 11:22:44 +08:00
Added new helper method #getDestinationPath to make path management in subcomponents easier
This commit is contained in:
@@ -94,4 +94,19 @@ describe('Utilities:Yeoman', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getDestinationPath', () => {
|
||||
|
||||
it('should return the correct filesystem path for all components', () => {
|
||||
|
||||
expect(utils.getDestinationPath('test', 'action', 'Actions')).to.equal('src/actions/TestActions.js');
|
||||
expect(utils.getDestinationPath('subfolder/test', 'action', 'Actions')).to.equal('src/actions/subfolder/TestActions.js');
|
||||
|
||||
expect(utils.getDestinationPath('test', 'source', 'Source')).to.equal('src/sources/TestSource.js');
|
||||
expect(utils.getDestinationPath('subfolder/test', 'source', 'Source')).to.equal('src/sources/subfolder/TestSource.js');
|
||||
|
||||
expect(utils.getDestinationPath('test', 'store', 'Store')).to.equal('src/stores/TestStore.js');
|
||||
expect(utils.getDestinationPath('subfolder/test', 'store', 'Store')).to.equal('src/stores/subfolder/TestStore.js');
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user