File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed
test/cases/parsing/issue-4940 Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change 1+ define ( "local-module-object" , function ( ) {
2+ return {
3+ foo : "bar"
4+ } ;
5+ } ) ;
6+
7+ define ( "local-side-effect" , function ( ) {
8+ return {
9+ foo : null
10+ } ;
11+ } ) ;
12+
113it ( "should create dependency when require is called with 'new' (object export)" , function ( ) {
214 const result = new require ( "./object-export" ) ;
315 result . foo . should . equal ( "bar" ) ;
@@ -9,3 +21,18 @@ it("should create dependency when require is called with 'new' (non-object expor
921 result . should . instanceof ( __webpack_require__ ) ;
1022 sideEffect . foo . should . equal ( "bar" ) ;
1123} ) ;
24+
25+ it ( "should create dependency when with a local dependency (object export)" , function ( ) {
26+ const result = new require ( "local-module-object" ) ;
27+ result . foo . should . equal ( "bar" ) ;
28+ } ) ;
29+
30+ it ( "should work within parentheses" , function ( ) {
31+ const result = new ( require ) ( "./object-export" ) ;
32+ result . foo . should . equal ( "bar" ) ;
33+ } ) ;
34+
35+ it ( "should work with local module in parentheses" , function ( ) {
36+ const result = new ( require ) ( "local-module-object" ) ;
37+ result . foo . should . equal ( "bar" ) ;
38+ } ) ;
You can’t perform that action at this time.
0 commit comments