How to run mocha and mocha-phantomjs tests from one “npm test” command in node.js?

前端 未结 3 1180
慢半拍i
慢半拍i 2020-12-07 17:11

I have got few node packages which works in node.js environment and also in browser. Now I have got two seperate tests (for each environment). What is the best way to run th

3条回答
  •  甜味超标
    2020-12-07 17:54

    Came here looking for information on configuring npm with karma. @dankohn's answer can be adapted thusly:

    "scripts": {
      "test": "npm run test-node && npm run test-browser",
      "test-node": "karma run",
      "test-browser": "karma start --single-run"
    }
    

    Hope this helps someone else out.

提交回复
热议问题