Skip to content

Commit

Permalink
add test case for global in harmony modules
Browse files Browse the repository at this point in the history
  • Loading branch information
sokra committed Jan 16, 2017
1 parent bfccb20 commit bd45bdc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/configCases/parsing/harmony-global/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
require("should");
it("should be able to use global in a harmony module", function() {
var x = require("./module1");
(x.default === global).should.be.ok();
});
1 change: 1 addition & 0 deletions test/configCases/parsing/harmony-global/module.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default 1;
3 changes: 3 additions & 0 deletions test/configCases/parsing/harmony-global/module1.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
var freeGlobal = typeof global === "object" && global && global.Object === Object && global;

export default freeGlobal;
6 changes: 6 additions & 0 deletions test/configCases/parsing/harmony-global/webpack.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
target: "web",
performance: {
hints: false
}
};

0 comments on commit bd45bdc

Please sign in to comment.