Skip to content

Commit

Permalink
test: update expected files since babel upgraded
Browse files Browse the repository at this point in the history
  • Loading branch information
sorrycc committed Jan 5, 2023
1 parent 54a94bc commit bedae9f
Show file tree
Hide file tree
Showing 41 changed files with 151 additions and 437 deletions.
14 changes: 4 additions & 10 deletions test/fixtures/array-expression/expected.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
"use strict";

var _button = _interopRequireDefault(require("antd/lib/button"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var a = [_button.default];
import _Button from "antd/lib/button";
var a = [_Button];
var b = {
'test': [_button.default]
'test': [_Button]
};
[_button.default].map(function () {});

[_Button].map(function () {});
12 changes: 3 additions & 9 deletions test/fixtures/as-arguments-identifier/expected.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
"use strict";

var _modal = _interopRequireDefault(require("antd/lib/modal"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _Modal = bind()(_modal.default);

var _newModal = new AnyClass(_modal.default);
import _Modal2 from "antd/lib/modal";
const _Modal = bind()(_Modal2);
const _newModal = new AnyClass(_Modal2);
9 changes: 2 additions & 7 deletions test/fixtures/as-arguments/expected.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
"use strict";

var _modal = _interopRequireDefault(require("antd/lib/modal"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _Modal = bind({})(_modal.default);
import _Modal2 from "antd/lib/modal";
const _Modal = bind({})(_Modal2);
9 changes: 2 additions & 7 deletions test/fixtures/binary-expression/expected.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
"use strict";

var _button = _interopRequireDefault(require("antd/lib/button"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var extraProps = undefined === _button.default ? {
import _Button from "antd/lib/button";
const extraProps = undefined === _Button ? {
type: 'primary'
} : {};
console.log(extraProps);
21 changes: 7 additions & 14 deletions test/fixtures/conditions/expected.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,7 @@
"use strict";

var _select = _interopRequireDefault(require("antd/lib/select"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

if (a === _select.default) {}

if (_select.default) {}

_select.default ? 'a' : 'b';
a ? _select.default : 2;
_select.default || 'a';
a || _select.default;
import _Select from "antd/lib/select";
if (a === _Select) {}
if (_Select) {}
_Select ? 'a' : 'b';
a ? _Select : 2;
_Select || 'a';
a || _Select;
15 changes: 4 additions & 11 deletions test/fixtures/custom-name-source-file/expected.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
"use strict";

var _react = _interopRequireDefault(require("react"));

var _button = _interopRequireDefault(require("antd/lib/button"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

ReactDOM.render( /*#__PURE__*/_react.default.createElement("div", {
component: _button.default
}));
import _Button from "antd/lib/button";
ReactDOM.render( /*#__PURE__*/React.createElement("div", {
component: _Button
}));
15 changes: 4 additions & 11 deletions test/fixtures/custom-name/expected.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
"use strict";

var _react = _interopRequireDefault(require("react"));

var _button = _interopRequireDefault(require("antd/lib/button"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

ReactDOM.render( /*#__PURE__*/_react.default.createElement("div", {
component: _button.default
}));
import _Button from "antd/lib/button";
ReactDOM.render( /*#__PURE__*/React.createElement("div", {
component: _Button
}));
14 changes: 3 additions & 11 deletions test/fixtures/custom-style-name-file/expected.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
"use strict";

var _react = _interopRequireDefault(require("react"));

require("../../../../element-ui/lib/theme-light/button");

var _button2 = _interopRequireDefault(require("element-ui/lib/button"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

ReactDOM.render( /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_button2.default, null, "xxxx")));
import "../../../../element-ui/lib/theme-light/button";
import _Button from "element-ui/lib/button";
ReactDOM.render( /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Button, null, "xxxx")));
14 changes: 3 additions & 11 deletions test/fixtures/custom-style-name/expected.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,3 @@
"use strict";

var _react = _interopRequireDefault(require("react"));

require("element-ui/lib/theme-light/button");

var _button2 = _interopRequireDefault(require("element-ui/lib/button"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

ReactDOM.render( /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_button2.default, null, "xxxx")));
import "element-ui/lib/theme-light/button";
import _Button from "element-ui/lib/button";
ReactDOM.render( /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Button, null, "xxxx")));
21 changes: 6 additions & 15 deletions test/fixtures/custom-style-path-ignore/expected.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
"use strict";

var _animation = _interopRequireDefault(require("antd/lib/animation"));

require("antd/lib/button/style/2x");

var _button = _interopRequireDefault(require("antd/lib/button"));

var _react = _interopRequireDefault(require("react"));

var _reactDom = _interopRequireDefault(require("react-dom"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

ReactDOM.render( /*#__PURE__*/_react.default.createElement(_animation.default, null, /*#__PURE__*/_react.default.createElement(_button.default, null, "xxxx")), document.getElementById("react-container"));
import _Animation from "antd/lib/animation";
import "antd/lib/button/style/2x";
import _Button from "antd/lib/button";
import React from "react";
import ReactDom from "react-dom";
ReactDOM.render( /*#__PURE__*/React.createElement(_Animation, null, /*#__PURE__*/React.createElement(_Button, null, "xxxx")), document.getElementById("react-container"));
18 changes: 5 additions & 13 deletions test/fixtures/custom-style-path/expected.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
"use strict";

require("antd/lib/button/style/2x");

var _button = _interopRequireDefault(require("antd/lib/button"));

var _react = _interopRequireDefault(require("react"));

var _reactDom = _interopRequireDefault(require("react-dom"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

ReactDOM.render( /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_button.default, null, "xxxx")), document.getElementById('react-container'));
import "antd/lib/button/style/2x";
import _Button from "antd/lib/button";
import React from 'react';
import ReactDom from 'react-dom';
ReactDOM.render( /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Button, null, "xxxx")), document.getElementById('react-container'));
9 changes: 2 additions & 7 deletions test/fixtures/execute-direct/expected.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
"use strict";

var _message2 = _interopRequireDefault(require("antd/lib/message"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

(0, _message2.default)('xxx');
import _message from "antd/lib/message";
_message('xxx');
9 changes: 2 additions & 7 deletions test/fixtures/execute-member/expected.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
"use strict";

var _message2 = _interopRequireDefault(require("antd/lib/message"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

_message2.default.success('xxx');
import _message from "antd/lib/message";
_message.success('xxx');
15 changes: 2 additions & 13 deletions test/fixtures/export-import/expected.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,2 @@
"use strict";

Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;

var _datePicker = _interopRequireDefault(require("antd/lib/date-picker"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

var _default = _datePicker.default;
exports.default = _default;
import _DatePicker from "antd/lib/date-picker";
export default _DatePicker;
10 changes: 3 additions & 7 deletions test/fixtures/expression-statement/expected.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
"use strict";

var _antdMobile = require("antd-mobile");

window.Toast = _antdMobile.Toast;

_antdMobile.Toast.success('test');
import { Toast } from 'antd-mobile';
window.Toast = Toast;
Toast.success('test');
12 changes: 3 additions & 9 deletions test/fixtures/file-name/expected.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
"use strict";

var _index = _interopRequireDefault(require("antd-mobile-fake-2.0/lib/select/index.native"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

if (_index.default) {}

console.log(_index.default);
import _Select from "antd-mobile-fake-2.0/lib/select/index.native";
if (_Select) {}
console.log(_Select);
9 changes: 2 additions & 7 deletions test/fixtures/import-alias/expected.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
"use strict";

var _select = _interopRequireDefault(require("antd/lib/select"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

if (_select.default) {
import _Select from "antd/lib/select";
if (_Select) {
console.log('foo');
}
22 changes: 6 additions & 16 deletions test/fixtures/import-css/expected.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
"use strict";

var _react = _interopRequireDefault(require("react"));

require("antd/lib/button/style");

var _button = _interopRequireDefault(require("antd/lib/button"));

require("antd/lib/message/style");

var _message2 = _interopRequireDefault(require("antd/lib/message"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

(0, _message2.default)('xxx');
ReactDOM.render( /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_button.default, null, "xxxx")));
import "antd/lib/button/style";
import _Button from "antd/lib/button";
import "antd/lib/message/style";
import _message from "antd/lib/message";
_message('xxx');
ReactDOM.render( /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Button, null, "xxxx")));
12 changes: 4 additions & 8 deletions test/fixtures/keep-named-import/expected.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
"use strict";

var _end2 = require("stream/lib/end");

var _start2 = require("stream/lib/start");

(0, _start2.start)();
(0, _end2.end)();
import { end as _end } from "stream/lib/end";
import { start as _start } from "stream/lib/start";
_start();
_end();
9 changes: 2 additions & 7 deletions test/fixtures/material-ui/expected.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,2 @@
"use strict";

var _Toolbar2 = _interopRequireDefault(require("material-ui/Toolbar"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

(0, _Toolbar2.default)('xxx');
import _Toolbar from "material-ui/Toolbar";
_Toolbar('xxx');
13 changes: 3 additions & 10 deletions test/fixtures/member-expression/expected.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
"use strict";

var _react = _interopRequireDefault(require("react"));

var _button = _interopRequireDefault(require("antd/lib/button"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

ReactDOM.render( /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_button.default, {
import _Button from "antd/lib/button";
ReactDOM.render( /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(_Button, {
type: "primary"
}, "Button")));
}, "Button")));
7 changes: 1 addition & 6 deletions test/fixtures/modules-false/expected.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
"use strict";

require("antd/lib/button/style");

var _button = _interopRequireDefault(require("antd/lib/button"));

var _react = _interopRequireDefault(require("react"));

var _reactDom = _interopRequireDefault(require("react-dom"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

ReactDOM.render( /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_button.default, null, "xxxx")), document.getElementById('react-container'));
ReactDOM.render( /*#__PURE__*/_react.default.createElement("div", null, /*#__PURE__*/_react.default.createElement(_button.default, null, "xxxx")), document.getElementById('react-container'));
18 changes: 5 additions & 13 deletions test/fixtures/multiple-libraries-hilojs/expected.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,5 @@
"use strict";

var _abc = _interopRequireDefault(require("hilojs/abc"));

var _class = _interopRequireDefault(require("hilojs/core/class"));

var _select = _interopRequireDefault(require("antd/lib/select"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

if (_select.default) {}

if (_class.default && _abc.default) {}
import _Abc from "hilojs/abc";
import _Class from "hilojs/core/class";
import _Select from "antd/lib/select";
if (_Select) {}
if (_Class && _Abc) {}
15 changes: 4 additions & 11 deletions test/fixtures/multiple-libraries/expected.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,4 @@
"use strict";

var _select = _interopRequireDefault(require("antd-mobile/lib/select"));

var _select2 = _interopRequireDefault(require("antd/lib/select"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

if (_select2.default) {}

if (_select.default) {}
import _Select2 from "antd-mobile/lib/select";
import _Select from "antd/lib/select";
if (_Select) {}
if (_Select2) {}
Loading

0 comments on commit bedae9f

Please sign in to comment.