<legend id='evnDf'><style id='evnDf'><dir id='evnDf'><q id='evnDf'></q></dir></style></legend>
  • <i id='evnDf'><tr id='evnDf'><dt id='evnDf'><q id='evnDf'><span id='evnDf'><b id='evnDf'><form id='evnDf'><ins id='evnDf'></ins><ul id='evnDf'></ul><sub id='evnDf'></sub></form><legend id='evnDf'></legend><bdo id='evnDf'><pre id='evnDf'><center id='evnDf'></center></pre></bdo></b><th id='evnDf'></th></span></q></dt></tr></i><div id='evnDf'><tfoot id='evnDf'></tfoot><dl id='evnDf'><fieldset id='evnDf'></fieldset></dl></div>
      <bdo id='evnDf'></bdo><ul id='evnDf'></ul>
  • <tfoot id='evnDf'></tfoot>

      <small id='evnDf'></small><noframes id='evnDf'>

        如何使用 Mocha 配置 TeamCity 构建?

        时间:2023-08-07

          <legend id='zhq8t'><style id='zhq8t'><dir id='zhq8t'><q id='zhq8t'></q></dir></style></legend>
          <tfoot id='zhq8t'></tfoot>

          <small id='zhq8t'></small><noframes id='zhq8t'>

            <tbody id='zhq8t'></tbody>

            <i id='zhq8t'><tr id='zhq8t'><dt id='zhq8t'><q id='zhq8t'><span id='zhq8t'><b id='zhq8t'><form id='zhq8t'><ins id='zhq8t'></ins><ul id='zhq8t'></ul><sub id='zhq8t'></sub></form><legend id='zhq8t'></legend><bdo id='zhq8t'><pre id='zhq8t'><center id='zhq8t'></center></pre></bdo></b><th id='zhq8t'></th></span></q></dt></tr></i><div id='zhq8t'><tfoot id='zhq8t'></tfoot><dl id='zhq8t'><fieldset id='zhq8t'></fieldset></dl></div>
            • <bdo id='zhq8t'></bdo><ul id='zhq8t'></ul>

                  本文介绍了如何使用 Mocha 配置 TeamCity 构建?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我有一个项目,我正在通过 teamcity 为 CI 设置.该项目本身是一个 nodejs 应用程序,它包括用 mocha 编写的测试,我们通过 jscoverage 进行介绍.在我正在设置的构建配置中,我有 3 个构建步骤在签到时发生.

                  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. 针对我所在项目中的文件夹调用 jscoverage.exe覆盖.

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

                  调用 mocha 以针对步骤 1 中的 jscovered 文件运行测试并输出到 html-cov 报告器

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

                  将生成的coverage.html 报告移至公共网络目录稍后浏览.

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

                  构建当前在第 2 步失败:mocha" 不存在于目录 C:NodeJSMeasuresAPI

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

                  我已确保在系统环境路径中包含 mocha 和我的所有节点包,并且我能够在命令提示符下访问它们,但 TeamCity 似乎看不到它们.

                  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 command prompt, but TeamCity doesnt appear to see them.

                  对于 jscoverage.exe,我必须包含完整路径.使用 mocha,我尝试包含安装 mocha 的节点全局安装的路径,但它给了我一个错误:

                  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:

                  .. ode_modulesmochainmocha"(在目录C:NodeJSMeasuresAPI"中):CreateProcess 错误=193,%1 不是有效的 Win32 应用程序

                  ".. ode_modulesmochainmocha" (in directory "C:NodeJSMeasuresAPI"): CreateProcess error=193, %1 is not a valid Win32 application

                  有人对 Teamcity 和 Mocha 有任何经验,以及如何让它们玩得更好?或与 nodejs、mocha 堆栈持续集成的任何想法?

                  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?

                  推荐答案

                  是的,这也发生在我身上,当时我正在设置 TeamCity 以在 Windows Server 上运行 mocha.解决方案是通过指定 mocha.cmd bat 文件的路径来调用 mocha.例如,如果您有文件夹 C:mocha 并且您已执行npm install mocha

                  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

                  在那个目录中,bat文件的路径将是

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

                  C:mocha ode_modules.binmocha.cmd

                  C:mocha ode_modules.binmocha.cmd

                  您可以通过下一条指令告诉 Teamcity 执行 mocha 命令:

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

                  C:mocha ode_modules.binmocha --ui tdd --reporter html-cov testmeasureDBTests.js > coverage.html

                  C:mocha ode_modules.binmocha --ui tdd --reporter html-cov testmeasureDBTests.js > coverage.html

                  这篇关于如何使用 Mocha 配置 TeamCity 构建?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:脚本缩小和与 MSBuild 的持续集成 下一篇:如何从命令行运行 QUnit 测试?

                  相关文章

                  最新文章

                  <small id='u6JEh'></small><noframes id='u6JEh'>

                  • <bdo id='u6JEh'></bdo><ul id='u6JEh'></ul>
                1. <i id='u6JEh'><tr id='u6JEh'><dt id='u6JEh'><q id='u6JEh'><span id='u6JEh'><b id='u6JEh'><form id='u6JEh'><ins id='u6JEh'></ins><ul id='u6JEh'></ul><sub id='u6JEh'></sub></form><legend id='u6JEh'></legend><bdo id='u6JEh'><pre id='u6JEh'><center id='u6JEh'></center></pre></bdo></b><th id='u6JEh'></th></span></q></dt></tr></i><div id='u6JEh'><tfoot id='u6JEh'></tfoot><dl id='u6JEh'><fieldset id='u6JEh'></fieldset></dl></div>

                      <tfoot id='u6JEh'></tfoot>
                      <legend id='u6JEh'><style id='u6JEh'><dir id='u6JEh'><q id='u6JEh'></q></dir></style></legend>