How to I configure TeamCity build with Mocha?

后端 未结 1 1702
逝去的感伤
逝去的感伤 2021-02-08 23:42

I have a project that I am setting up through teamcity for CI. The project itself is a nodejs application and it includes test written in mocha, which we cover through jscoverag

1条回答
  •  走了就别回头了
    2021-02-09 00:33

    Yes , this happened to me too, when I was setting up TeamCity to run mocha on Windows Server. The solution was to call mocha by specifying path to the mocha.cmd bat file. For example , if you have folder C:\mocha and you have executed npm install mocha

    in that directory , than path to the bat file will be

    C:\mocha\node_modules.bin\mocha.cmd

    And you can tell Teamcity to execute mocha command by giving it next instruction :

    C:\mocha\node_modules.bin\mocha --ui tdd --reporter html-cov test\measureDBTests.js > coverage.html

    0 讨论(0)
提交回复
热议问题