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
Modules that return an object or only declare named exports are no longer mutated to include a `default` export.
Addresses ember-cli#114
Breaking change: loader.js will no longer create a default export.
Copy file name to clipboardexpand all lines: tests/all.js
+3-122
Original file line number
Diff line number
Diff line change
@@ -640,19 +640,14 @@ test('if factory returns a value it is used as export', function() {
640
640
equal(foo.bar,'bar');
641
641
});
642
642
643
-
test('if a module has no default property assume the return is the default',function(){
644
-
vardeprecationMessage;
645
-
require.deprecationLogger=function(message){
646
-
deprecationMessage=message;
647
-
};
648
-
643
+
test('if a module has no default property it does not create one',function(){
649
644
define('foo',[],function(){
650
645
return{
651
646
bar: 'bar'
652
647
};
653
648
});
654
649
655
-
varfoo=require('foo')['default'];
650
+
varfoo=require('foo');
656
651
657
652
varstats=statsForMonitor('loaderjs',tree);
658
653
@@ -669,117 +664,12 @@ test('if a module has no default property assume the return is the default', fun
669
664
pendingQueueLength: 1
670
665
});
671
666
667
+
strictEqual(foo.default,undefined);
672
668
equal(foo.bar,'bar');
673
-
674
-
equal(deprecationMessage,'The `foo` module does not define a default export, but loader.js generated one anyway. This behavior is deprecated and will be removed in v5.0.0.');
675
669
});
676
670
677
671
678
-
test('if a CJS style module has no default export assume module.exports is the default',function(){
equal(deprecationMessage,'The `Foo` module does not define a default export, but loader.js generated one anyway. This behavior is deprecated and will be removed in v5.0.0.');
710
-
});
711
-
712
-
713
-
test('if a module has no default property assume its export is default (function)',function(){
equal(deprecationMessage,'The `foo` module does not define a default export, but loader.js generated one anyway. This behavior is deprecated and will be removed in v5.0.0.');
743
-
});
744
-
745
-
test('if a module has no default property assume its export is default (object)',function(){
equal(deprecationMessage,'The `foo` module does not define a default export, but loader.js generated one anyway. This behavior is deprecated and will be removed in v5.0.0.');
775
-
});
776
-
777
672
test('does not add default if export is frozen',function(){
0 commit comments