In your package.json scripts:
"test": "react-scripts test --watchAll=false"
Or npm test -- --watchAll=false
Or yarn test --watchAll=false
Note: the flag used to be called --no-watch in react-scripts < 3.0: https://github.com/facebook/create-react-app/blob/master/CHANGELOG.md#remove---no-watch-flag