Skip to content

Instantly share code, notes, and snippets.

@kornysietsma
Created August 12, 2011 06:23
Show Gist options
  • Save kornysietsma/1141566 to your computer and use it in GitHub Desktop.
Save kornysietsma/1141566 to your computer and use it in GitHub Desktop.
sbt sample
lazy val javascriptIntegrationTest = task {
val statusLogger: JasmineStatusLogger = new JasmineStatusLogger(log)
val workingDirectory = new File(info.projectPath.asFile, "src/it/javascript").getPath
val phantomJasmine = workingDirectory + "/phantom-jasmine.js"
val specRunner = workingDirectory + "/SpecRunner.html"
val reportDir = new File(info.projectPath.asFile.getParent,
"app/target/reports/javascript-test/").getPath
try {
run(List("/usr/bin/phantomjs", phantomJasmine, specRunner, reportDir), true)
None
} catch {
case e: Exception => {
Some("jasmine specs failed. To see why, run the chrome-for-tests command in a terminal, not in sbt")
}
}
} dependsOn(javascriptTemplates)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment