admin管理员组

文章数量:1387407

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 jscoverage. In the build configuration I'm setting up I have 3 build steps which occur on checkin.

  1. call jscoverage.exe against the folders in my project that I'm covering.

  2. call mocha to run the test against the jscovered files from step 1 and output to the html-cov reporter

  3. move the generated coverage.html report into a public web directory to browse later.

The build currently fails on step 2: mocha" is not present in directory C:\NodeJS\MeasuresAPI

I've made sure to include mocha and all my node packages in the system environment paths and I am able to access them in the mand prompt, but TeamCity doesnt appear to see them.

for the jscoverage.exe, I had to include the full path. With mocha, I tried including the path to my node global installation where mocha installed to but it gives me an error:

"..\node_modules\mocha\bin\mocha" (in directory "C:\NodeJS\MeasuresAPI"): CreateProcess error=193, %1 is not a valid Win32 application

Anyone had any experience with Teamcity and Mocha and how to get them to play nice? or any ideas for continuous integration with a nodejs, mocha stack?

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 jscoverage. In the build configuration I'm setting up I have 3 build steps which occur on checkin.

  1. call jscoverage.exe against the folders in my project that I'm covering.

  2. call mocha to run the test against the jscovered files from step 1 and output to the html-cov reporter

  3. move the generated coverage.html report into a public web directory to browse later.

The build currently fails on step 2: mocha" is not present in directory C:\NodeJS\MeasuresAPI

I've made sure to include mocha and all my node packages in the system environment paths and I am able to access them in the mand prompt, but TeamCity doesnt appear to see them.

for the jscoverage.exe, I had to include the full path. With mocha, I tried including the path to my node global installation where mocha installed to but it gives me an error:

"..\node_modules\mocha\bin\mocha" (in directory "C:\NodeJS\MeasuresAPI"): CreateProcess error=193, %1 is not a valid Win32 application

Anyone had any experience with Teamcity and Mocha and how to get them to play nice? or any ideas for continuous integration with a nodejs, mocha stack?

Share Improve this question edited May 21, 2013 at 13:42 Drew Noakes 312k172 gold badges698 silver badges765 bronze badges asked Mar 30, 2012 at 0:35 willzwillz 2,0503 gold badges21 silver badges24 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 6

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 mand by giving it next instruction :

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

本文标签: javascriptHow to I configure TeamCity build with MochaStack Overflow