Added test for preventing fragment with jsxFactory
This commit is contained in:
parent
5dd1a47c6b
commit
a83ec4167e
5 changed files with 66 additions and 0 deletions
13
tests/baselines/reference/jsxFactoryAndFragment.errors.txt
Normal file
13
tests/baselines/reference/jsxFactoryAndFragment.errors.txt
Normal file
|
@ -0,0 +1,13 @@
|
|||
tests/cases/compiler/jsxFactoryAndFragment.tsx(3,1): error TS17016: JSX fragment is not supported when using --jsxFactory
|
||||
tests/cases/compiler/jsxFactoryAndFragment.tsx(4,1): error TS17016: JSX fragment is not supported when using --jsxFactory
|
||||
|
||||
|
||||
==== tests/cases/compiler/jsxFactoryAndFragment.tsx (2 errors) ====
|
||||
declare var h: any;
|
||||
|
||||
<></>;
|
||||
~~~~~
|
||||
!!! error TS17016: JSX fragment is not supported when using --jsxFactory
|
||||
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS17016: JSX fragment is not supported when using --jsxFactory
|
13
tests/baselines/reference/jsxFactoryAndFragment.js
Normal file
13
tests/baselines/reference/jsxFactoryAndFragment.js
Normal file
|
@ -0,0 +1,13 @@
|
|||
//// [jsxFactoryAndFragment.tsx]
|
||||
declare var h: any;
|
||||
|
||||
<></>;
|
||||
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
|
||||
|
||||
//// [jsxFactoryAndFragment.js]
|
||||
h(React.Fragment, null);
|
||||
h(React.Fragment, null,
|
||||
h("span", null, "1"),
|
||||
h(React.Fragment, null,
|
||||
h("span", null, "2.1"),
|
||||
h("span", null, "2.2")));
|
13
tests/baselines/reference/jsxFactoryAndFragment.symbols
Normal file
13
tests/baselines/reference/jsxFactoryAndFragment.symbols
Normal file
|
@ -0,0 +1,13 @@
|
|||
=== tests/cases/compiler/jsxFactoryAndFragment.tsx ===
|
||||
declare var h: any;
|
||||
>h : Symbol(h, Decl(jsxFactoryAndFragment.tsx, 0, 11))
|
||||
|
||||
<></>;
|
||||
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
|
||||
>span : Symbol(unknown)
|
||||
>span : Symbol(unknown)
|
||||
>span : Symbol(unknown)
|
||||
>span : Symbol(unknown)
|
||||
>span : Symbol(unknown)
|
||||
>span : Symbol(unknown)
|
||||
|
20
tests/baselines/reference/jsxFactoryAndFragment.types
Normal file
20
tests/baselines/reference/jsxFactoryAndFragment.types
Normal file
|
@ -0,0 +1,20 @@
|
|||
=== tests/cases/compiler/jsxFactoryAndFragment.tsx ===
|
||||
declare var h: any;
|
||||
>h : any
|
||||
|
||||
<></>;
|
||||
><></> : any
|
||||
|
||||
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
|
||||
><><span>1</span><><span>2.1</span><span>2.2</span></></> : any
|
||||
><span>1</span> : any
|
||||
>span : any
|
||||
>span : any
|
||||
><><span>2.1</span><span>2.2</span></> : any
|
||||
><span>2.1</span> : any
|
||||
>span : any
|
||||
>span : any
|
||||
><span>2.2</span> : any
|
||||
>span : any
|
||||
>span : any
|
||||
|
7
tests/cases/compiler/jsxFactoryAndFragment.tsx
Normal file
7
tests/cases/compiler/jsxFactoryAndFragment.tsx
Normal file
|
@ -0,0 +1,7 @@
|
|||
//@jsx: react
|
||||
//@jsxfactory: h
|
||||
|
||||
declare var h: any;
|
||||
|
||||
<></>;
|
||||
<><span>1</span><><span>2.1</span><span>2.2</span></></>;
|
Loading…
Reference in a new issue