Browse Source

Test that top-level side effects involving imports are preserved.

With the current implementation of rollup, this test fails. To make it pass, you can replace `import obj from './obj;` in lib.js with `var obj = {};`, suggesting that it's the import itself that somehow confuses rollup.
contingency-plan
Brian Donovan 9 years ago
parent
commit
5033267048
  1. 3
      test/function/top-level-side-effect-on-imported/_config.js
  2. 5
      test/function/top-level-side-effect-on-imported/lib.js
  3. 3
      test/function/top-level-side-effect-on-imported/main.js
  4. 1
      test/function/top-level-side-effect-on-imported/obj.js
  5. 2
      test/function/top-level-side-effects-are-preserved/_config.js

3
test/function/top-level-side-effect-on-imported/_config.js

@ -0,0 +1,3 @@
module.exports = {
description: 'top level function calls are preserved'
};

5
test/function/top-level-side-effect-on-imported/lib.js

@ -0,0 +1,5 @@
import obj from './obj';
obj.value = 'augmented';
export default obj;

3
test/function/top-level-side-effect-on-imported/main.js

@ -0,0 +1,3 @@
import lib from './lib';
assert.strictEqual(lib.value, 'augmented');

1
test/function/top-level-side-effect-on-imported/obj.js

@ -0,0 +1 @@
export default { value: 'original' };

2
test/function/top-level-side-effects-are-preserved/_config.js

@ -1,3 +1,3 @@
module.exports = { module.exports = {
description: 'top level side effects are preserved' description: 'top level side effects on imports are preserved'
}; };

Loading…
Cancel
Save