react-code-dataset / next.js /test /production /app-dir /actions-tree-shaking /shared-module-actions /shared-module-actions.test.ts
Download next.js/test/production/app-dir/actions-tree-shaking/shared-module-actions/shared-module-actions.test.ts from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 981 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/production/app-dir/actions-tree-shaking/shared-module-actions/shared-module-actions.test.ts
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/test/production/app-dir/actions-tree-shaking/shared-module-actions/shared-module-actions.test.ts
-
curl -L -o shared-module-actions.test.ts https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/test/production/app-dir/actions-tree-shaking/shared-module-actions/shared-module-actions.test.ts
981 Bytes
| import { nextTestSetup } from 'e2e-utils' | |
| import { | |
| getActionsRoutesStateByRuntime, | |
| markLayoutAsEdge, | |
| } from '../_testing/utils' | |
| // TODO: revisit when we have a better side-effect free transform approach for server action | |
| ;(process.env.IS_TURBOPACK_TEST ? describe : describe.skip)( | |
| 'actions-tree-shaking - shared-module-actions', | |
| () => { | |
| const { next } = nextTestSetup({ | |
| files: __dirname, | |
| }) | |
| if (process.env.TEST_EDGE) { | |
| markLayoutAsEdge(next) | |
| } | |
| it('should not have the unused action in the manifest', async () => { | |
| const actionsRoutesState = await getActionsRoutesStateByRuntime(next) | |
| expect(actionsRoutesState).toMatchObject({ | |
| 'app/server/one/page': { | |
| rsc: 3, | |
| }, | |
| 'app/server/two/page': { | |
| rsc: 3, | |
| }, | |
| 'app/client/one/page': { | |
| 'action-browser': 1, | |
| }, | |
| 'app/client/two/page': { | |
| 'action-browser': 1, | |
| }, | |
| }) | |
| }) | |
| } | |
| ) | |