You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Amplify Gen2 documentation for testing setup (vitest) #8476
Is your feature request related to a problem? Please describe.
There is no clear example on how configure testing environment, if should us node or jsdom, if it is need runWithAmplifyContext...
Describe the solution you'd like
An example of setup.ts file that provides auth, client, storage to be used in test framework like vitest
Describe alternatives you've considered
some LLM instructions to share with AI agent and let it build the setup files. Also a direction on how to setup would be helpful, like emulating ssr context, or configure to use jsdom environment...
Additional context
Vitest supports different environments ('node', 'jsdom', 'happy-dom'). When using standard library functions (not the one coming from 'aws-amplify/auth/server' or 'aws-amplify/api/server') the identiy is not availble in the resolver context.
changed the title [-]Amplify Gen2 documentation for testing stupe (vitest)[/-][+]Amplify Gen2 documentation for testing setup (vitest)[/+]on Nov 25, 2025
Thank you for creating this ticket! We love hearing ideas from the community on how to improve our docs. We will review it with the team and get back to you once we have an update.
Activity
[-]Amplify Gen2 documentation for testing stupe (vitest)[/-][+]Amplify Gen2 documentation for testing setup (vitest)[/+]osama-rizk commentedon Dec 4, 2025
Hi @sot1986 ,
Thank you for creating this ticket! We love hearing ideas from the community on how to improve our docs. We will review it with the team and get back to you once we have an update.