2017-01-11 17:51:58 +08:00
|
|
|
import "./module";
|
|
|
|
|
2018-01-27 06:59:38 +08:00
|
|
|
expect(function() {
|
2017-01-11 17:51:58 +08:00
|
|
|
module.exports = 1;
|
2018-01-27 06:59:38 +08:00
|
|
|
}).toThrowError();
|
2017-01-11 17:51:58 +08:00
|
|
|
|
2018-01-27 05:51:03 +08:00
|
|
|
expect((typeof module.exports)).toBe("undefined");
|
2017-01-11 17:51:58 +08:00
|
|
|
|
2018-01-27 05:51:03 +08:00
|
|
|
expect((typeof define)).toBe("undefined");
|
2018-01-27 06:59:38 +08:00
|
|
|
expect(function() {
|
2017-01-11 17:51:58 +08:00
|
|
|
define(function() {})
|
2018-01-27 06:59:38 +08:00
|
|
|
}).toThrowError(/define is not defined/);
|
2017-01-11 17:51:58 +08:00
|
|
|
|
|
|
|
export default 1234;
|
|
|
|
|
2017-05-25 19:12:34 +08:00
|
|
|
if(eval("typeof exports !== \"undefined\"")) {
|
2021-12-13 05:57:14 +08:00
|
|
|
// exports is node.js exports and not webpack's
|
2018-01-27 05:51:03 +08:00
|
|
|
expect(Object.keys(exports)).toEqual([]);
|
2017-05-25 19:12:34 +08:00
|
|
|
}
|