add jsx and react transformer
This commit is contained in:
3
test/fixtures/syntax/jsx/annotation/actual.js
vendored
Normal file
3
test/fixtures/syntax/jsx/annotation/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/** @jsx CUSTOM_DOM */
|
||||
|
||||
<a></a>
|
||||
3
test/fixtures/syntax/jsx/annotation/expected.js
vendored
Normal file
3
test/fixtures/syntax/jsx/annotation/expected.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
/** @jsx CUSTOM_DOM */
|
||||
|
||||
CUSTOM_DOM.a(null);
|
||||
1
test/fixtures/syntax/jsx/empty/actual.js
vendored
Normal file
1
test/fixtures/syntax/jsx/empty/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<x>{}</x>
|
||||
1
test/fixtures/syntax/jsx/empty/expected.js
vendored
Normal file
1
test/fixtures/syntax/jsx/empty/expected.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
x(null, null);
|
||||
2
test/fixtures/syntax/jsx/everything/actual.js
vendored
Normal file
2
test/fixtures/syntax/jsx/everything/actual.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
<X data-prop={x ? <Y prop={2} /> : <Z>
|
||||
</Z>}></X>
|
||||
3
test/fixtures/syntax/jsx/everything/expected.js
vendored
Normal file
3
test/fixtures/syntax/jsx/everything/expected.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
X({
|
||||
"data-prop": x ? Y({ prop: 2 }) : Z(null, "\n")
|
||||
});
|
||||
5
test/fixtures/syntax/jsx/expressions/actual.js
vendored
Normal file
5
test/fixtures/syntax/jsx/expressions/actual.js
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
(<X>{a}</X>);
|
||||
|
||||
(<X>{a} {b}</X>);
|
||||
|
||||
(<X prop={a} yes></X>);
|
||||
3
test/fixtures/syntax/jsx/expressions/expected.js
vendored
Normal file
3
test/fixtures/syntax/jsx/expressions/expected.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
X(null, a);
|
||||
X(null, [a, ' ', b]);
|
||||
X({ prop: a, yes: true });
|
||||
1
test/fixtures/syntax/jsx/known-tags/actual.js
vendored
Normal file
1
test/fixtures/syntax/jsx/known-tags/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<a></a>
|
||||
1
test/fixtures/syntax/jsx/known-tags/expected.js
vendored
Normal file
1
test/fixtures/syntax/jsx/known-tags/expected.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
React.DOM.a(null);
|
||||
1
test/fixtures/syntax/jsx/member-expression/actual.js
vendored
Normal file
1
test/fixtures/syntax/jsx/member-expression/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<Test.X></Test.X>
|
||||
1
test/fixtures/syntax/jsx/member-expression/expected.js
vendored
Normal file
1
test/fixtures/syntax/jsx/member-expression/expected.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
Test.X(null);
|
||||
1
test/fixtures/syntax/jsx/no-xml-namespaces/actual.js
vendored
Normal file
1
test/fixtures/syntax/jsx/no-xml-namespaces/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<Test:X></Test:X>
|
||||
3
test/fixtures/syntax/jsx/no-xml-namespaces/options.json
vendored
Normal file
3
test/fixtures/syntax/jsx/no-xml-namespaces/options.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"throws": "Namespace tags are not supported. ReactJSX is not XML."
|
||||
}
|
||||
3
test/fixtures/syntax/jsx/self-closing-tags/actual.js
vendored
Normal file
3
test/fixtures/syntax/jsx/self-closing-tags/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
(<X />);
|
||||
|
||||
(<X prop="1" />);
|
||||
2
test/fixtures/syntax/jsx/self-closing-tags/expected.js
vendored
Normal file
2
test/fixtures/syntax/jsx/self-closing-tags/expected.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
X(null);
|
||||
X({ prop: '1' });
|
||||
1
test/fixtures/syntax/jsx/simple-tags/actual.js
vendored
Normal file
1
test/fixtures/syntax/jsx/simple-tags/actual.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
<X></X>
|
||||
1
test/fixtures/syntax/jsx/simple-tags/expected.js
vendored
Normal file
1
test/fixtures/syntax/jsx/simple-tags/expected.js
vendored
Normal file
@@ -0,0 +1 @@
|
||||
X(null);
|
||||
3
test/fixtures/syntax/jsx/tags-with-children/actual.js
vendored
Normal file
3
test/fixtures/syntax/jsx/tags-with-children/actual.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
(<X prop="2"><Y /></X>);
|
||||
|
||||
(<X prop="2"><Y /><Z /></X>);
|
||||
2
test/fixtures/syntax/jsx/tags-with-children/expected.js
vendored
Normal file
2
test/fixtures/syntax/jsx/tags-with-children/expected.js
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
X({ prop: '2' }, Y(null));
|
||||
X({ prop: '2' }, [Y(null), Z(null)]);
|
||||
13
test/fixtures/syntax/jsx/tags-with-literals/actual.js
vendored
Normal file
13
test/fixtures/syntax/jsx/tags-with-literals/actual.js
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
(<X> </X>);
|
||||
|
||||
(<X>
|
||||
</X>);
|
||||
|
||||
(<X>
|
||||
string
|
||||
</X>);
|
||||
|
||||
(<X>
|
||||
string
|
||||
string
|
||||
</X>);
|
||||
4
test/fixtures/syntax/jsx/tags-with-literals/expected.js
vendored
Normal file
4
test/fixtures/syntax/jsx/tags-with-literals/expected.js
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
X(null, ' ');
|
||||
X(null, '\n');
|
||||
X(null, '\n string\n');
|
||||
X(null, '\n string\n string\n ');
|
||||
Reference in New Issue
Block a user