gradle-js-plugin
gradle-js-plugin copied to clipboard
Add support for JSTestDriver
Could consider this project: http://code.google.com/p/jstd-maven-plugin/
But taking care to exclude transitive dependencies: http://code.google.com/p/jstd-maven-plugin/issues/detail?id=5
Any progress on this? We are switching to gradle and would love to have support for jsTestDriver :)
I have part of the work done on this, but certainly not ready yet. In the meantime, I run JSTestDriver with Gradle this way:
task jstd(type: Exec, dependsOn: 'init', description: 'runs JS tests through JsTestDriver') {
// Default to MacOS and check for other environments
def firefoxPath = '/Applications/Firefox.app/Contents/MacOS/firefox'
if ("uname".execute().text.trim() != 'Darwin') {
firefoxPath = "which firefox".execute().text
}
commandLine = ['/usr/bin/env', 'DISPLAY=:1', 'java', '-jar', "${projectDir}/test/lib/JsTestDriver-1.3.3d.jar", '--config', "${projectDir}/test/jsTestDriver.conf", '--port', '4224', '--browser', firefoxPath, '--tests', 'all', '--testOutput', buildDir]
}
I know it sucks, but hey, it works well. You can even get code coverage with my lcov to cobertura XML tool:
task jsCoverage(type: Exec, dependsOn: 'jstd', description: 'JS code coverage with cobertura') {
commandLine = ['python', "${projectDir}/test/lib/lcov_cobertura.py", '-b', "${projectDir}/", '-e', 'test.spec', '-e', 'test.lib', '-o', "${buildDir}/coverage.xml", "${buildDir}/jsTestDriver.conf-coverage.dat"]
}
:zap:
Thanks for the examples, do you have any rough estimate, a couple of months, a year?
We have actually been using your lcov to cobertura XML tool for the last 6 months(from ant) and love it, so thanks for that aswell :)
@ki82 This is realistically a few months away as I have some more pressing work I need to finish.
Glad you like the lcov tool :)