• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

karma-runner/maven-karma-plugin: Maven plugin for running tests using Karma.

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

karma-runner/maven-karma-plugin

开源软件地址(OpenSource Url):

https://github.com/karma-runner/maven-karma-plugin

开源编程语言(OpenSource Language):

Java 100.0%

开源软件介绍(OpenSource Introduction):

maven-karma-plugin

Provides the ability to run tests via Karma as part of your Maven build.

It has been years since I used this plugin and, quite honestly given the lack of use and activity on it, I'd almost forgot that it even existed. Consequently, I have no wish to continue to maintain the project. If someone wishes to pick up the project I'm more than happy to hand over the reins to someone with more use for it. Alternatively, just fork it.

If you do wish to take it over please get in touch with an org owner

Usage

Note that the plugin expects Karma (and nodejs of course) to have been installed beforehand and for the karma executable to be on the system path.

Example of a typical usage:

<plugin>
    <groupId>com.kelveden</groupId>
    <artifactId>maven-karma-plugin</artifactId>
    <version>1.6</version>
    <executions>
        <execution>
            <goals>
                <goal>start</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <browsers>PhantomJS</browsers>
    </configuration>
</plugin>

Full Example:

<plugin>
    <groupId>com.kelveden</groupId>
    <artifactId>maven-karma-plugin</artifactId>
    <version>1.6</version>
    <executions>
        <execution>
            <phase>test</phase>
            <goals>
                <goal>start</goal>
            </goals>
        </execution>
    </executions>
    <configuration>
        <karmaExecutable>${basedir}/node_modules/.bin/karma</karmaExecutable>        
        <configFile>src/main/webapp/resources/karma-0.10.2.conf.js</configFile>
        <junitReportFile>src/main/webapp/resources/test-results.xml</junitReportFile>
        <reportsDirectory>${project.build.directory}/karma-reports</reportsDirectory>
        <browsers>PhantomJS</browsers>
        <autoWatch>false</autoWatch>
        <singleRun>true</singleRun>
        <colors>true</colors>
        <skipKarma>false</skipKarma>
        <skipTests>false</skipTests>
        <karmaFailureIgnore>false</karmaFailureIgnore>
        <reporters>dots,junit</reporters>
    </configuration>
</plugin>

(In particular, note the use of the karmaExecutable property that implies that the karma executable installed to the local node_modules folder will be used instead of the globally installed version.)

More information

Just run:

mvn help:describe -Dplugin=com.kelveden:maven-karma-plugin -Ddetail

The plugin simply shells out to karma; so the properties you specify in the configuration section will be passed on as arguments to Karma itself. See the Karma configuration documentation for more information on the arguments available.

Note that only the subset of karma start arguments that are relevant are supported by the plugin - there's no support for the --port argument, for example.

Note also that if a property isn't specified in the POM it will not be passed to karma start at all - i.e. Karma will pick the default value for the corresponding argument. The exception to this rule is the "singleRun" property which is set to "true" by default as this will be the most common use case in the context of a Maven build.

Using a local karma installation

By default, the plugin assumes that karma is installed globally via npm install -g karma. However, if you prefer to use a locally installed karma you can do so by telling the plugin where to find it with the karmaExecutable configuration property; e.g. ${basedir}/node_modules/.bin/karma. (See the full example pom configuration above.)

Contributing

Bug reports are welcome - pull requests to fix aforementioned bugs even more so! Apart from that, there really isn't much to the plugin and I think it's best to keep it that way. Am open to other thoughts on that though.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
ZipCodeCore/Maven.TicTacToe发布时间:2022-08-17
下一篇:
akikeadk/maven-project: jleetutorial/maven-project发布时间:2022-08-17
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap