move all plugin tests out of babel-core and into their appropriate folders
This commit is contained in:
@@ -10,5 +10,8 @@
|
||||
],
|
||||
"dependencies": {
|
||||
"babel-runtime": "^5.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"babel-helper-plugin-test-runner": "^6.0.0"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
var Foo = React.createClass({
|
||||
render: function() {
|
||||
return <div className={this.props.className}>
|
||||
<span />
|
||||
</div>;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,9 @@
|
||||
var _ref = <span />;
|
||||
|
||||
var Foo = React.createClass({
|
||||
render: function () {
|
||||
return <div className={this.props.className}>
|
||||
{_ref}
|
||||
</div>;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,5 @@
|
||||
var Foo = require("Foo");
|
||||
|
||||
function render() {
|
||||
return <Foo />;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
var Foo = require("Foo");
|
||||
|
||||
var _ref = <Foo />;
|
||||
|
||||
function render() {
|
||||
return _ref;
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
function render() {
|
||||
var children = <b></b>;
|
||||
|
||||
if (someCondition) {
|
||||
children = <span></span>;
|
||||
}
|
||||
|
||||
return <div>{children}</div>;
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
var _ref = <b></b>;
|
||||
|
||||
var _ref2 = <span></span>;
|
||||
|
||||
function render() {
|
||||
var children = _ref;
|
||||
|
||||
if (someCondition) {
|
||||
children = _ref2;
|
||||
}
|
||||
|
||||
return <div>{children}</div>;
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
function renderSome(a, b) {
|
||||
if (a) {
|
||||
return <div>{b}</div>
|
||||
} else {
|
||||
return <span>{b}</span>
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
function renderSome(a, b) {
|
||||
if (a) {
|
||||
return <div>{b}</div>;
|
||||
} else {
|
||||
return <span>{b}</span>;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
function render(text) {
|
||||
return function () {
|
||||
return <foo>{text}</foo>;
|
||||
};
|
||||
}
|
||||
|
||||
var Foo2 = require("Foo");
|
||||
|
||||
function createComponent(text) {
|
||||
return function render() {
|
||||
return <Foo2>{text}</Foo2>;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
function render(text) {
|
||||
var _ref = <foo>{text}</foo>;
|
||||
|
||||
return function () {
|
||||
return _ref;
|
||||
};
|
||||
}
|
||||
|
||||
var Foo2 = require("Foo");
|
||||
|
||||
function createComponent(text) {
|
||||
var _ref2 = <Foo2>{text}</Foo2>;
|
||||
|
||||
return function render() {
|
||||
return _ref2;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
var Foo = React.createClass({
|
||||
render: function render() {
|
||||
return <div foo={notDeclared}></div>;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
var _ref = <div foo={notDeclared}></div>;
|
||||
|
||||
var Foo = React.createClass({
|
||||
render: function render() {
|
||||
return _ref;
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,7 @@
|
||||
function render() {
|
||||
return <foo />;
|
||||
}
|
||||
|
||||
function render() {
|
||||
return <div className="foo"><input type="checkbox" checked={true} /></div>;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
var _ref = <foo />;
|
||||
|
||||
function render() {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
var _ref2 = <div className="foo"><input type="checkbox" checked={true} /></div>;
|
||||
|
||||
function render() {
|
||||
return _ref2;
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
function render() {
|
||||
return <foo />;
|
||||
}
|
||||
|
||||
function render() {
|
||||
var text = getText();
|
||||
return function () {
|
||||
return <foo>{text}</foo>;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
var _typeofReactElement = typeof Symbol === "function" && Symbol.for && Symbol.for("react.element") || 0xeac7;
|
||||
|
||||
var _ref = {
|
||||
$$typeof: _typeofReactElement,
|
||||
type: "foo",
|
||||
key: null,
|
||||
ref: null,
|
||||
props: {},
|
||||
_owner: null
|
||||
};
|
||||
function render() {
|
||||
return _ref;
|
||||
}
|
||||
|
||||
function render() {
|
||||
var text = getText();
|
||||
var _ref2 = {
|
||||
$$typeof: _typeofReactElement,
|
||||
type: "foo",
|
||||
key: null,
|
||||
ref: null,
|
||||
props: {
|
||||
children: text
|
||||
},
|
||||
_owner: null
|
||||
};
|
||||
return function () {
|
||||
return _ref2;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["transform-react-constant-elements", "transform-react-inline-elements", "syntax-jsx"]
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
function render() {
|
||||
var text = getText();
|
||||
return function () {
|
||||
return <foo>{text}</foo>;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
function render() {
|
||||
var text = getText();
|
||||
|
||||
var _ref = <foo>{text}</foo>;
|
||||
|
||||
return function () {
|
||||
return _ref;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"plugins": ["syntax-jsx", "transform-react-constant-elements"]
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
function render(text) {
|
||||
return function () {
|
||||
return <div>{text}</div>;
|
||||
};
|
||||
}
|
||||
|
||||
function render() {
|
||||
return function (text) {
|
||||
return <div>{text}</div>;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
function render(text) {
|
||||
var _ref = <div>{text}</div>;
|
||||
|
||||
return function () {
|
||||
return _ref;
|
||||
};
|
||||
}
|
||||
|
||||
function render() {
|
||||
return function (text) {
|
||||
return <div>{text}</div>;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
function render(text) {
|
||||
text += "yes";
|
||||
|
||||
return function () {
|
||||
return <div>{text}</div>;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
function render(text) {
|
||||
text += "yes";
|
||||
|
||||
var _ref = <div>{text}</div>;
|
||||
|
||||
return function () {
|
||||
return _ref;
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
function render() {
|
||||
return <foo ref="foobar" />;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
function render() {
|
||||
return <foo ref="foobar" />;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
function render() {
|
||||
return <foo {...foobar} />;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
function render() {
|
||||
return <foo {...foobar} />;
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
require("babel-helper-plugin-test-runner")(__dirname);
|
||||
Reference in New Issue
Block a user