MCPcopy
hub / github.com/BuilderIO/mitosis / runTestsForJsx

Function runTestsForJsx

packages/core/src/__tests__/test-generator.ts:646–674  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

644});
645
646export const runTestsForJsx = () => {
647 test('Remove Internal mitosis package', async () => {
648 const component = parseJsx((await basicMitosis).code, {
649 compileAwayPackages: ['@dummy/custom-mitosis'],
650 });
651 expect(component).toMatchSnapshot();
652 });
653
654 const configurations: Array<Parameters<typeof parseJsx>[1] & { testName: string }> = [
655 { typescript: true, testName: 'Typescript' },
656 { typescript: false, testName: 'Javascript' },
657 ];
658
659 configurations.forEach((config) => {
660 describe(config.testName, () => {
661 JSX_TESTS.forEach((tests) => {
662 Object.keys(tests).forEach((key) => {
663 test(key, async () => {
664 const singleTest = tests[key];
665 const testPromise = isTestWithFailFor(singleTest) ? singleTest.file : singleTest;
666 const t = await testPromise;
667 const component = parseJsx(t.code, { ...config, filePath: t.filePath });
668 expect(component).toMatchSnapshot();
669 });
670 });
671 });
672 });
673 });
674};
675export const runTestsForSvelteSyntax = () => {
676 Object.keys(SVELTE_SYNTAX_TESTS).forEach((key) => {
677 test(key, async () => {

Callers 1

parse-jsx.test.tsFile · 0.90

Calls 3

parseJsxFunction · 0.90
testFunction · 0.85
isTestWithFailForFunction · 0.85

Tested by

no test coverage detected