【问题标题】:Is there a way to run nodeunit tests through maven/ant有没有办法通过 maven/ant 运行 nodeunit 测试
【发布时间】:2011-10-17 23:04:33
【问题描述】:

我在 nodeunit 中为我的 node.js 应用程序创建了一些单元测试。我希望能够通过 maven / ant 运行测试,因为我打算通过 Jenkins 运行它们。有没有人成功做到这一点?

【问题讨论】:

    标签: unit-testing ant maven node.js nodeunit


    【解决方案1】:

    Maven exec plugin 可用于运行 Nodeunit 和相应的测试。

      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.1.1</version>
        <executions>
          <execution>
            <goals>
              <goal>exec</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <executable>nodeunit</executable>
          <workingDirectory>./</workingDirectory>            
          <arguments>
            <argument>tests/node/ServerTests.js</argument>
          </arguments>          
        </configuration>
      </plugin>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-22
      • 2021-12-16
      • 1970-01-01
      • 2010-10-24
      相关资源
      最近更新 更多