You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -262,6 +263,40 @@ describe('when modules dir does not exist', function() {
262
263
});
263
264
})
264
265
266
+
// Test basic functionality
267
+
describe('invocation with no settings - webpack 5',function(){
268
+
269
+
before(function(){
270
+
mockNodeModules();
271
+
context.instance=nodeExternals();
272
+
});
273
+
274
+
describe('should invoke a commonjs callback',function(){
275
+
it('when given an existing module',assertResultWebpack5('moduleA','commonjs moduleA'));
276
+
it('when given another existing module',assertResultWebpack5('moduleB','commonjs moduleB'));
277
+
it('when given another existing module for scoped package',assertResultWebpack5('@organisation/moduleA','commonjs @organisation/moduleA'));
278
+
it('when given an existing sub-module',assertResultWebpack5('moduleA/sub-module','commonjs moduleA/sub-module'));
279
+
it('when given an existing file in a sub-module',assertResultWebpack5('moduleA/another-sub/index.js','commonjs moduleA/another-sub/index.js'));
280
+
it('when given an existing file in a scoped package',assertResultWebpack5('@organisation/moduleA/index.js','commonjs @organisation/moduleA/index.js'))
281
+
it('when given an another existing file in a scoped package',assertResultWebpack5('@organisation/base-node/vs/base/common/paths','commonjs @organisation/base-node/vs/base/common/paths'))
282
+
283
+
});
284
+
285
+
describe('should invoke an empty callback',function(){
286
+
it('when given a non-node module',assertResultWebpack5('non-node-module',undefined));
287
+
it('when given a module in the file but not in folder',assertResultWebpack5('moduleE',undefined));
288
+
it('when given a relative path',assertResultWebpack5('./src/index.js',undefined));
289
+
it('when given a different absolute path',assertResultWebpack5('/test/node_modules/non-node-module',undefined));
290
+
it('when given a complex different absolute path',assertResultWebpack5('/test/node_modules/non-node-module/node_modules/moduleA',undefined));
291
+
it('when given an absolute path',assertResultWebpack5('/test/node_modules/moduleA',undefined));
292
+
it('when given an existing sub-module inside node_modules',assertResultWebpack5('/moduleA/node_modules/moduleB',undefined));
0 commit comments