如何在github动作yml文件中运行/完成测试条?

时间:2020-03-31 22:29:45

标签: reactjs github github-actions

在我的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操作中,它在运行时会无限期地挂起。

1 个答案:

答案 0 :(得分:0)

只需使用--watchAll创建另一个用于本地使用的命令。示例:

"test": "react-scripts test --env=jsdom",
"test:coverage": "yarn test --coverage",
"test:coverage-watch": "yarn test:coverage --watchAll"