next.js/test/production/app-dir/actions-tree-shaking/use-effect-actions/use-effect-actions.test.ts
use-effect-actions.test.ts24 lines641 B
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",
       ],
     }
    `)
  })
})
Quest for Codev2.0.0
/
SIGN IN