Running CRA Jest in non-interactive mode

后端 未结 3 1462
感动是毒
感动是毒 2021-02-02 04:53

Update: my use case is mainly to run tests at CI, but overriding default CRA Jest parameters is something I\'m generally wondering about.


I\'m run

3条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-02 05:46

    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

提交回复
热议问题