Skip to content
Permalink
Browse files

fix(Fragment): fix tsconfig Fragment

  • Loading branch information
adamdbradley committed Aug 24, 2020
1 parent 540c551 commit ba0ea8d3c324c5a8589a1a3c674a369c8f926aa8
@@ -59,7 +59,7 @@ export const transpileModule = (config: d.Config, input: string, transformOpts:
tsCompilerOptions.jsxFactory = 'h';
}

if (tsCompilerOptions.jsxFragmentFactory != null && !isString(tsCompilerOptions.jsxFragmentFactory)) {
if (tsCompilerOptions.jsx != null && !isString(tsCompilerOptions.jsxFragmentFactory)) {
tsCompilerOptions.jsxFragmentFactory = 'Fragment';
}

@@ -31,6 +31,7 @@ export {
getElement,
getMode,
getRenderingRef,
Fragment,
forceUpdate,
h,
Host,
@@ -1,8 +1,38 @@
import { Component, Host, Prop, State, h } from '@stencil/core';
import { Component, Host, Prop, State, h, Fragment } from '@stencil/core';
import { newSpecPage } from '@stencil/core/testing';
import { FunctionalComponent } from '../../declarations';

describe('jsx', () => {
it('Fragment', async () => {
@Component({ tag: 'cmp-a' })
class CmpA {
render() {
return (
<>
<div>A</div>
<div>B</div>
</>
);
}
}

const { root } = await newSpecPage({
components: [CmpA],
html: `<cmp-a></cmp-a>`,
});

expect(root).toEqualHtml(`
<cmp-a>
<div>
A
</div>
<div>
B
</div>
</cmp-a>
`);
});

it('render template', async () => {
@Component({ tag: 'cmp-a' })
class CmpA {
@@ -8,6 +8,7 @@
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"jsxFactory": "h",
"jsxFragmentFactory": "Fragment",
"lib": ["dom", "es2017", "esnext.array"],
"module": "esnext",
"moduleResolution": "node",
@@ -58,7 +58,7 @@ export const jestPreprocessor = {
filePath,
jestConfigStr,
!!transformOptions.instrument,
5, // cache buster
6, // cache buster
];

return key.join(':');
@@ -8,6 +8,7 @@
"forceConsistentCasingInFileNames": true,
"jsx": "react",
"jsxFactory": "h",
"jsxFragmentFactory": "Fragment",
"lib": ["dom", "es2018", "esnext.array"],
"module": "esnext",
"moduleResolution": "node",

0 comments on commit ba0ea8d

Please sign in to comment.
You can’t perform that action at this time.