Skip to content

Commit 5478a40

Browse files
MustafaHaddaraljharb
authored andcommittedJul 27, 2021
[Tests] update webpack resolver unit tests to check module resolution
1 parent 96e4332 commit 5478a40

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"main": "lib/index.js",
3+
"module": "src/index.js",
4+
"jsnext:main": "lib/index.js"
5+
}

‎resolvers/webpack/test/package-mains/module-and-jsnext/src/index.js

Whitespace-only changes.

‎resolvers/webpack/test/packageMains.js

+5
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ describe('packageMains', function () {
2121
.to.equal(path.join(__dirname, 'package-mains', 'jsnext', 'src', 'index.js'));
2222
});
2323

24+
it('captures module instead of jsnext', function () {
25+
expect(webpack.resolve('./module-and-jsnext', file)).property('path')
26+
.to.equal(path.join(__dirname, 'package-mains', 'module-and-jsnext', 'src', 'index.js'));
27+
});
28+
2429
it('captures webpack', function () {
2530
expect(webpack.resolve('./webpack', file)).property('path')
2631
.to.equal(path.join(__dirname, 'package-mains', 'webpack', 'webpack.js'));

0 commit comments

Comments
 (0)
Please sign in to comment.