Skip to content

Commit

Permalink
Breaking test for #1068
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp committed Aug 30, 2018
1 parent 1397fe6 commit 6255900
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
8 changes: 8 additions & 0 deletions test/tree_shaking_test.js
Expand Up @@ -126,6 +126,14 @@ describe("Tree-shaking", function(){
assert.equal(connect.didFail, true, "marked as failed");
});
});

describe.only("ES modules imported by CommonJS modules", function() {
it("Tree-shakes their ES module dependencies", function() {
let mod = app.dep5dep5AnotherESModule;
assert.equal(typeof mod.mainThing, "function", "Kept the used export");
assert.equal(typeof mod.another, "undefined", "Removed the unused export");
});
});
});

describe("treeShaking: false", function(){
Expand Down
9 changes: 6 additions & 3 deletions test/treeshake/basics/main.js
Expand Up @@ -53,7 +53,8 @@ export default function(){
steal.import("dep4/other"),
steal.import("dep4/and-another"),
steal.import("~/from-exports"),
shouldFail
shouldFail,
steal.import("dep5/another-es-module")
]);

return p
Expand All @@ -64,7 +65,8 @@ export default function(){
dep4Other,
dep4AndAnother,
fromExports,
canConnect
canConnect,
dep5dep5AnotherESModule
]) => {
return {
anon,
Expand All @@ -75,7 +77,8 @@ export default function(){
dep4AndAnother,
fromExports,
dep5,
canConnect
canConnect,
dep5dep5AnotherESModule
};
});
};
8 changes: 8 additions & 0 deletions test/treeshake/basics/node_modules/dep5/another-es-module.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions test/treeshake/basics/node_modules/dep5/es-module.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions test/treeshake/basics/node_modules/dep5/main.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6255900

Please sign in to comment.