我已配置为在提交之前运行测试。但这仅适用于Ubuntu。

这是我现在拥有的:

 "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject",
    "test:all": "CI=true react-scripts test"
  },
  "husky": {
    "hooks": {
      "pre-commit": "npm run test:all"
    }
  },


如何设置交叉env变量以在任何操作系统中运行它们?

最佳答案

使用cross-env包:

  "test:all": "cross-env CI=true react-scripts test"

关于javascript - 如何设置交叉env变量以在提交之前启动测试?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/59081894/

10-12 17:28