在我的React应用中,我有脚本:
"test": "react-scripts test --env=jsdom",
"test:coverage": "yarn test --coverage --watchAll",
// in my yml file:
- name: Yarn install, Build and Test
run: |
yarn
yarn test:coverage
yarn build
测试完成后如何退出观看模式?因为在github操作中,它在运行时会无限期地挂起。
答案 0 :(得分:0)
只需使用--watchAll
创建另一个用于本地使用的命令。示例:
"test": "react-scripts test --env=jsdom",
"test:coverage": "yarn test --coverage",
"test:coverage-watch": "yarn test:coverage --watchAll"