gradle-js-plugin icon indicating copy to clipboard operation
gradle-js-plugin copied to clipboard

Add support for JSTestDriver

Open eriwen opened this issue 13 years ago • 4 comments

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

eriwen avatar Jan 11 '12 16:01 eriwen

Any progress on this? We are switching to gradle and would love to have support for jsTestDriver :)

ki82 avatar Sep 14 '12 12:09 ki82

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:

eriwen avatar Sep 14 '12 15:09 eriwen

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 avatar Sep 18 '12 06:09 ki82

@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 :)

eriwen avatar Sep 18 '12 13:09 eriwen