Skip to content

Commit 436eb4e

Browse files
committed
fix existing tests
1 parent 123cb65 commit 436eb4e

File tree

8 files changed

+25
-10
lines changed

8 files changed

+25
-10
lines changed

src/testRunner/unittests/services/transpile.ts

+4
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,10 @@ var x = 0;`, {
363363
options: { compilerOptions: { jsxFactory: "createElement" }, fileName: "input.js", reportDiagnostics: true }
364364
});
365365

366+
transpilesCorrectly("Supports setting 'jsxFragmentFactory'", "x;", {
367+
options: { compilerOptions: { jsxFactory: "x", jsxFragmentFactory: "frag" }, fileName: "input.js", reportDiagnostics: true }
368+
});
369+
366370
transpilesCorrectly("Supports setting 'removeComments'", "x;", {
367371
options: { compilerOptions: { removeComments: true }, fileName: "input.js", reportDiagnostics: true }
368372
});

tests/baselines/reference/api/tsserverlibrary.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2710,6 +2710,7 @@ declare namespace ts {
27102710
project?: string;
27112711
reactNamespace?: string;
27122712
jsxFactory?: string;
2713+
jsxFragmentFactory?: string;
27132714
composite?: boolean;
27142715
incremental?: boolean;
27152716
tsBuildInfoFile?: string;

tests/baselines/reference/api/typescript.d.ts

+1
Original file line numberDiff line numberDiff line change
@@ -2710,6 +2710,7 @@ declare namespace ts {
27102710
project?: string;
27112711
reactNamespace?: string;
27122712
jsxFactory?: string;
2713+
jsxFragmentFactory?: string;
27132714
composite?: boolean;
27142715
incremental?: boolean;
27152716
tsBuildInfoFile?: string;

tests/baselines/reference/inlineJsxFactoryWithFragmentIsError.errors.txt

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
tests/cases/conformance/jsx/inline/index.tsx(3,1): error TS17017: JSX fragment is not supported when using an inline JSX factory pragma
2-
tests/cases/conformance/jsx/inline/reacty.tsx(3,1): error TS17017: JSX fragment is not supported when using an inline JSX factory pragma
1+
tests/cases/conformance/jsx/inline/index.tsx(3,1): error TS17017: An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments.
2+
tests/cases/conformance/jsx/inline/reacty.tsx(3,1): error TS17017: An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments.
33

44

55
==== tests/cases/conformance/jsx/inline/renderer.d.ts (0 errors) ====
@@ -17,10 +17,10 @@ tests/cases/conformance/jsx/inline/reacty.tsx(3,1): error TS17017: JSX fragment
1717
import * as React from "./renderer";
1818
<><h></h></>
1919
~~~~~~~~~~~~
20-
!!! error TS17017: JSX fragment is not supported when using an inline JSX factory pragma
20+
!!! error TS17017: An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments.
2121
==== tests/cases/conformance/jsx/inline/index.tsx (1 errors) ====
2222
/** @jsx dom */
2323
import { dom } from "./renderer";
2424
<><h></h></>
2525
~~~~~~~~~~~~
26-
!!! error TS17017: JSX fragment is not supported when using an inline JSX factory pragma
26+
!!! error TS17017: An @jsxFrag pragma is required when using an @jsx pragma with JSX fragments.
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,5 @@
1+
{
2+
"compilerOptions": {
3+
"jsxFragmentFactory": "someString"
4+
}
5+
}

tests/baselines/reference/transpile/Supports setting jsxFragmentFactory.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/baselines/reference/transpile/Supports setting jsxFragmentFactory.oldTranspile.js

+2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)