aidenybai / million

Optimize React performance and make your React 70% faster in minutes, not months.
https://million.dev
MIT License
16.38k stars 577 forks source link

test: add a `react.test.tsx` and `react-server.test.tsx` test suites #343

Closed aidenybai closed 1 year ago

aidenybai commented 1 year ago

⚠️ For CodeDay Labs students only! ⚠️

Is your feature request related to a problem? Please describe.

Currently, we have test suites for some parts of the mono repo, but we are missing test, particularly for the React components.

Describe the solution you'd like

Your job is to write at least 3 tests for both react.test.tsx and react-server.test.tsx, utilizing the packages/react and packages/react-server monorepo packages.

You will need to use @testing-library/react (basic tutorial) to complete this task.

**Do note that we use a custom JSX transform. This means, you will have to handwrite React.createElement calls instead of JSX`:

An example component you could use

import { createElement } from 'react';

function Component() {
    return createElement('div', { title: 'hello' }, 'test'); // would represent <div title="hello>test</div>
}

Other examples of test suites within the repo: https://github.com/aidenybai/million/blob/main/test/block.test.tsx

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs within the next 7 days.