Skip to content

Commit 975e7b8

Browse files
committed
add jsxFragmentFactory compiler option tests
1 parent 577da2f commit 975e7b8

19 files changed

+211
-6
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
tests/cases/compiler/jsxFactoryAndFragment.tsx(3,1): error TS17016: JSX fragment is not supported when using --jsxFactory
2-
tests/cases/compiler/jsxFactoryAndFragment.tsx(4,1): error TS17016: JSX fragment is not supported when using --jsxFactory
3-
tests/cases/compiler/jsxFactoryAndFragment.tsx(4,17): error TS17016: JSX fragment is not supported when using --jsxFactory
1+
tests/cases/compiler/jsxFactoryAndFragment.tsx(3,1): error TS17016: The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.
2+
tests/cases/compiler/jsxFactoryAndFragment.tsx(4,1): error TS17016: The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.
3+
tests/cases/compiler/jsxFactoryAndFragment.tsx(4,17): error TS17016: The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.
44

55

66
==== tests/cases/compiler/jsxFactoryAndFragment.tsx (3 errors) ====
77
declare var h: any;
88

99
<></>;
1010
~~~~~
11-
!!! error TS17016: JSX fragment is not supported when using --jsxFactory
11+
!!! error TS17016: The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.
1212
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
1313
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14-
!!! error TS17016: JSX fragment is not supported when using --jsxFactory
14+
!!! error TS17016: The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.
1515
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16-
!!! error TS17016: JSX fragment is not supported when using --jsxFactory
16+
!!! error TS17016: The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//// [jsxFactoryAndJsxFragmentFactory.tsx]
2+
declare var h: any;
3+
4+
<></>;
5+
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
6+
7+
//// [jsxFactoryAndJsxFragmentFactory.js]
8+
h(Frag, null);
9+
h(Frag, null,
10+
h("span", null, "1"),
11+
h(Frag, null,
12+
h("span", null, "2.1"),
13+
h("span", null, "2.2")));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
=== tests/cases/compiler/jsxFactoryAndJsxFragmentFactory.tsx ===
2+
declare var h: any;
3+
>h : Symbol(h, Decl(jsxFactoryAndJsxFragmentFactory.tsx, 0, 11))
4+
5+
<></>;
6+
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
=== tests/cases/compiler/jsxFactoryAndJsxFragmentFactory.tsx ===
2+
declare var h: any;
3+
>h : any
4+
5+
<></>;
6+
><></> : error
7+
8+
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
9+
><><span>1</span><><span>2.1</span><span>2.2</span></></> : error
10+
><span>1</span> : error
11+
>span : any
12+
>span : any
13+
><><span>2.1</span><span>2.2</span></> : error
14+
><span>2.1</span> : error
15+
>span : any
16+
>span : any
17+
><span>2.2</span> : error
18+
>span : any
19+
>span : any
20+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error TS18035: Invalid value for 'jsxFragmentFactory'. '234' is not a valid identifier or qualified-name.
2+
3+
4+
!!! error TS18035: Invalid value for 'jsxFragmentFactory'. '234' is not a valid identifier or qualified-name.
5+
==== tests/cases/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.tsx (0 errors) ====
6+
declare var h: any;
7+
8+
<></>;
9+
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//// [jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.tsx]
2+
declare var h: any;
3+
4+
<></>;
5+
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
6+
7+
//// [jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.js]
8+
h(React.Fragment, null);
9+
h(React.Fragment, null,
10+
h("span", null, "1"),
11+
h(React.Fragment, null,
12+
h("span", null, "2.1"),
13+
h("span", null, "2.2")));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
=== tests/cases/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.tsx ===
2+
declare var h: any;
3+
>h : Symbol(h, Decl(jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.tsx, 0, 11))
4+
5+
<></>;
6+
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
=== tests/cases/compiler/jsxFactoryAndJsxFragmentFactoryErrorNotIdentifier.tsx ===
2+
declare var h: any;
3+
>h : any
4+
5+
<></>;
6+
><></> : any
7+
8+
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
9+
><><span>1</span><><span>2.1</span><span>2.2</span></></> : any
10+
><span>1</span> : any
11+
>span : any
12+
>span : any
13+
><><span>2.1</span><span>2.2</span></> : any
14+
><span>2.1</span> : any
15+
>span : any
16+
>span : any
17+
><span>2.2</span> : any
18+
>span : any
19+
>span : any
20+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//// [jsxFactoryAndJsxFragmentFactoryNull.tsx]
2+
declare var h: any;
3+
4+
<></>;
5+
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
6+
7+
//// [jsxFactoryAndJsxFragmentFactoryNull.js]
8+
h(null, null);
9+
h(null, null,
10+
h("span", null, "1"),
11+
h(null, null,
12+
h("span", null, "2.1"),
13+
h("span", null, "2.2")));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
=== tests/cases/compiler/jsxFactoryAndJsxFragmentFactoryNull.tsx ===
2+
declare var h: any;
3+
>h : Symbol(h, Decl(jsxFactoryAndJsxFragmentFactoryNull.tsx, 0, 11))
4+
5+
<></>;
6+
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
=== tests/cases/compiler/jsxFactoryAndJsxFragmentFactoryNull.tsx ===
2+
declare var h: any;
3+
>h : any
4+
5+
<></>;
6+
><></> : error
7+
8+
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
9+
><><span>1</span><><span>2.1</span><span>2.2</span></></> : error
10+
><span>1</span> : error
11+
>span : any
12+
>span : any
13+
><><span>2.1</span><span>2.2</span></> : error
14+
><span>2.1</span> : error
15+
>span : any
16+
>span : any
17+
><span>2.2</span> : error
18+
>span : any
19+
>span : any
20+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
tests/cases/compiler/jsxFactoryButNoJsxFragmentFactory.tsx(3,1): error TS17016: The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.
2+
tests/cases/compiler/jsxFactoryButNoJsxFragmentFactory.tsx(4,1): error TS17016: The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.
3+
tests/cases/compiler/jsxFactoryButNoJsxFragmentFactory.tsx(4,17): error TS17016: The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.
4+
5+
6+
==== tests/cases/compiler/jsxFactoryButNoJsxFragmentFactory.tsx (3 errors) ====
7+
declare var h: any;
8+
9+
<></>;
10+
~~~~~
11+
!!! error TS17016: The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.
12+
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
13+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
14+
!!! error TS17016: The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.
15+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16+
!!! error TS17016: The 'jsxFragmentFactory' compiler option must be provided to use JSX fragments with the 'jsxFactory' compiler option.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
//// [jsxFactoryButNoJsxFragmentFactory.tsx]
2+
declare var h: any;
3+
4+
<></>;
5+
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
6+
7+
//// [jsxFactoryButNoJsxFragmentFactory.js]
8+
h(React.Fragment, null);
9+
h(React.Fragment, null,
10+
h("span", null, "1"),
11+
h(React.Fragment, null,
12+
h("span", null, "2.1"),
13+
h("span", null, "2.2")));
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
=== tests/cases/compiler/jsxFactoryButNoJsxFragmentFactory.tsx ===
2+
declare var h: any;
3+
>h : Symbol(h, Decl(jsxFactoryButNoJsxFragmentFactory.tsx, 0, 11))
4+
5+
<></>;
6+
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
=== tests/cases/compiler/jsxFactoryButNoJsxFragmentFactory.tsx ===
2+
declare var h: any;
3+
>h : any
4+
5+
<></>;
6+
><></> : any
7+
8+
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
9+
><><span>1</span><><span>2.1</span><span>2.2</span></></> : any
10+
><span>1</span> : any
11+
>span : any
12+
>span : any
13+
><><span>2.1</span><span>2.2</span></> : any
14+
><span>2.1</span> : any
15+
>span : any
16+
>span : any
17+
><span>2.2</span> : any
18+
>span : any
19+
>span : any
20+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//@jsx: react
2+
//@jsxFactory: h
3+
//@jsxFragmentFactory: Frag
4+
5+
declare var h: any;
6+
7+
<></>;
8+
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//@jsx: react
2+
//@jsxFactory: h
3+
//@jsxFragmentFactory: 234
4+
5+
declare var h: any;
6+
7+
<></>;
8+
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//@jsx: react
2+
//@jsxFactory: h
3+
//@jsxFragmentFactory: null
4+
5+
declare var h: any;
6+
7+
<></>;
8+
<><span>1</span><><span>2.1</span><span>2.2</span></></>;

0 commit comments

Comments
 (0)