vitest-dev/vitest#3077 (comment)
docker build . -t vitest
docker run -it -v ./src:/app/src vitest /bin/bash
Play with configs, my findings:
- It is more likely to hang when test cases failed. (not sure, you can try comment & uncomment
data-testid="message"
in Message.tsx) - Node 18/19 will hang, while it seems that there are no issues with version 20+.
- Setting
globals: true
and using the global vitest function increases the possibility of hanging. - The higher count of tests, the higher the chance of hanging.