Skip to content

Commit 68c44ad

Browse files
zhaoshengjunsokra
authored andcommitted
chore(): add test cases
1 parent a1815f8 commit 68c44ad

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export default function test() {
2+
return "OK";
3+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
it("should pass when required by CommonJS module", function () {
2+
var test1 = require('./a').default;
3+
test1().should.be.eql("OK");
4+
});
5+
6+
it("should pass when use babeljs transpiler", function() {
7+
//the following are generated code by use babeljs.
8+
// use it this way will save trouble to setup babel-loader
9+
// the babeljs transpiled code depends on the __esMoudule to be set
10+
var _test = require('./a');
11+
var _test2 = _interopRequireDefault(_test);
12+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13+
var test2 = (0, _test2.default)();
14+
test2.should.be.eql("OK");
15+
})

0 commit comments

Comments
 (0)