I have created some unit tests for my node.js application in nodeunit. I want to be able to run the tests through maven / ant, because I intend to run them through Jenkins. Has anyone had 开发者_StackOverflowany success doing this?
The Maven exec plugin can be used to run Nodeunit and the appropriate tests.
<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>
精彩评论