Skip to content

Commit

Permalink
chore: add a test
Browse files Browse the repository at this point in the history
Signed-off-by: weiran.zsd <weiran.zsd@alibaba-inc.com>
  • Loading branch information
aladdin-add committed Oct 31, 2018
1 parent 7c8f0c9 commit 119188d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions test/configCases/plugins/provide-plugin/foo.mjs
@@ -0,0 +1,3 @@
export default function fff() {
return typeof esm;
}
5 changes: 5 additions & 0 deletions test/configCases/plugins/provide-plugin/index.js
Expand Up @@ -56,3 +56,8 @@ it("should provide ES2015 modules", function() {
expect((es2015_alias)).toBe("ECMAScript Harmony");
expect((es2015_year)).toBe(2015);
});

it("should not provide for mjs", function(){
var foo = require(__dirname + "/foo.mjs").default;
expect(foo()).toBe("undefined");
});
3 changes: 2 additions & 1 deletion test/configCases/plugins/provide-plugin/webpack.config.js
Expand Up @@ -10,7 +10,8 @@ module.exports = {
es2015_name: ["./harmony", "default"],
es2015_alias: ["./harmony", "alias"],
es2015_year: ["./harmony", "year"],
"this.aaa": "./aaa"
"this.aaa": "./aaa",
esm: "fail"
})
]
};

0 comments on commit 119188d

Please sign in to comment.