mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
```
// This is only used by Webpack to correctly output the manifest. It's value shouldn't be relied
// upon externally. It's possible that the same action can be in different layers in a single
// page, which cannot be modelled with this API anyway.
```
24 lines
641 B
TypeScript
24 lines
641 B
TypeScript
import {
|
|
nextTestSetupActionTreeShaking,
|
|
getActionsRoutesStateByRuntime,
|
|
} from '../_testing/utils'
|
|
|
|
describe('actions-tree-shaking - use-effect-actions', () => {
|
|
const { next } = nextTestSetupActionTreeShaking({
|
|
files: __dirname,
|
|
})
|
|
|
|
it('should not tree shake the used action under useEffect', async () => {
|
|
const actionsRoutesState = await getActionsRoutesStateByRuntime(next)
|
|
expect(actionsRoutesState).toMatchInlineSnapshot(`
|
|
{
|
|
"app/mixed/page": [
|
|
"app/mixed/actions.ts#action1",
|
|
"app/mixed/actions.ts#action2",
|
|
"app/mixed/actions.ts#action3",
|
|
],
|
|
}
|
|
`)
|
|
})
|
|
})
|