Skip to content

Commit

Permalink
add react state tests (#1606)
Browse files Browse the repository at this point in the history
* 🪩

* ff
  • Loading branch information
samijaber authored Oct 24, 2024
1 parent 8c2be87 commit 7a09a3a
Show file tree
Hide file tree
Showing 12 changed files with 38,823 additions and 241 deletions.
8,157 changes: 8,157 additions & 0 deletions packages/core/src/__tests__/__snapshots__/react-state-builder.test.ts.snap

Large diffs are not rendered by default.

8,251 changes: 8,251 additions & 0 deletions packages/core/src/__tests__/__snapshots__/react-state-mobx.test.ts.snap

Large diffs are not rendered by default.

7,996 changes: 7,996 additions & 0 deletions packages/core/src/__tests__/__snapshots__/react-state-solid.test.ts.snap

Large diffs are not rendered by default.

7,996 changes: 7,996 additions & 0 deletions packages/core/src/__tests__/__snapshots__/react-state-valtio.test.ts.snap

Large diffs are not rendered by default.

6,116 changes: 6,116 additions & 0 deletions packages/core/src/__tests__/__snapshots__/react-state-variables.test.ts.snap

Large diffs are not rendered by default.

478 changes: 239 additions & 239 deletions packages/core/src/__tests__/__snapshots__/react.test.ts.snap

Large diffs are not rendered by default.

12 changes: 12 additions & 0 deletions packages/core/src/__tests__/react-state-builder.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { componentToReact } from '../generators/react';
import { runTestsForTarget } from './test-generator';

describe('React - stateType: builder', () => {
runTestsForTarget({
options: {
stateType: 'builder',
},
target: 'react',
generator: componentToReact,
});
});
12 changes: 12 additions & 0 deletions packages/core/src/__tests__/react-state-mobx.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { componentToReact } from '../generators/react';
import { runTestsForTarget } from './test-generator';

describe('React - stateType: mobx', () => {
runTestsForTarget({
options: {
stateType: 'mobx',
},
target: 'react',
generator: componentToReact,
});
});
12 changes: 12 additions & 0 deletions packages/core/src/__tests__/react-state-solid.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { componentToReact } from '../generators/react';
import { runTestsForTarget } from './test-generator';

describe('React - stateType: solid', () => {
runTestsForTarget({
options: {
stateType: 'solid',
},
target: 'react',
generator: componentToReact,
});
});
12 changes: 12 additions & 0 deletions packages/core/src/__tests__/react-state-valtio.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { componentToReact } from '../generators/react';
import { runTestsForTarget } from './test-generator';

describe('React - stateType: valtio', () => {
runTestsForTarget({
options: {
stateType: 'valtio',
},
target: 'react',
generator: componentToReact,
});
});
12 changes: 12 additions & 0 deletions packages/core/src/__tests__/react-state-variables.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { componentToReact } from '../generators/react';
import { runTestsForTarget } from './test-generator';

describe('React - stateType: variables', () => {
runTestsForTarget({
options: {
stateType: 'variables',
},
target: 'react',
generator: componentToReact,
});
});
10 changes: 8 additions & 2 deletions packages/core/src/__tests__/react.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@ import { runTestsForTarget } from './test-generator';

import stamped from './data/blocks/stamped-io.raw.tsx?raw';

describe('React', () => {
runTestsForTarget({ options: {}, target: 'react', generator: componentToReact });
describe('React - stateType: useState', () => {
runTestsForTarget({
options: {
stateType: 'useState',
},
target: 'react',
generator: componentToReact,
});
test('stamped (useState)', () => {
const component = parseJsx(stamped);
const output = componentToReact({
Expand Down

0 comments on commit 7a09a3a

Please sign in to comment.