Skip to content

Commit

Permalink
Add tests for resolving using webpack resolve.root
Browse files Browse the repository at this point in the history
  • Loading branch information
pahen committed Jan 4, 2017
1 parent c9b1795 commit 8452575
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"commander": "^2.9.0",
"commondir": "^1.0.1",
"debug": "^2.2.0",
"dependency-tree": "^5.7.1",
"dependency-tree": "^5.7.5",
"graphviz": "^0.0.8",
"mz": "^2.4.0",
"rc": "^1.1.6",
Expand Down
13 changes: 13 additions & 0 deletions test/es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,17 @@ describe('ES6', () => {
done();
}).catch(done);
});

it('supports resolve root paths in webpack config', (done) => {
madge(dir + '/webpack/src/sub/index.js', {
webpackConfig: dir + '/webpack/webpack.config.js'
}).then((res) => {
res.obj().should.eql({
'index': ['rel'],
'abs': [],
'rel': ['abs']
});
done();
}).catch(done);
});
});
Empty file added test/es6/webpack/src/sub/abs.js
Empty file.
1 change: 1 addition & 0 deletions test/es6/webpack/src/sub/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import rel from './rel.js';
1 change: 1 addition & 0 deletions test/es6/webpack/src/sub/rel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import abs from 'sub/abs.js';
9 changes: 9 additions & 0 deletions test/es6/webpack/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
'use strict';

const path = require('path');

module.exports = {
resolve: {
root: path.resolve(__dirname, './src')
}
};

0 comments on commit 8452575

Please sign in to comment.