com.github.searls.jasmine.GenerateManualRunnerMojo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jasmine-maven-plugin Show documentation
Show all versions of jasmine-maven-plugin Show documentation
A JavaScript unit test plugin that processes JavaScript sources and Jasmine specs, prepares test runner
HTML files, executes Jasmine specs headlessly with HtmlUnit, and produces JUnit XML reports
package com.github.searls.jasmine;
import java.io.IOException;
/**
* @component
* @goal generateManualRunner
* @phase generate-sources
*/
public class GenerateManualRunnerMojo extends AbstractJasmineMojo {
public void run() throws IOException {
if(writingAManualSpecRunnerIsNecessary()) {
getLog().info("Generating runner '"+manualSpecRunnerHtmlFileName+"' in the Jasmine plugin's target directory to open in a browser to facilitate faster feedback.");
new CreatesManualRunner(this).create();
} else {
getLog().warn("Skipping manual spec runner generation. Check to make sure that both JavaScript directories `"+sources.getDirectory().getAbsolutePath()+"` and `"+specs.getDirectory().getAbsolutePath()+"` exist.");
}
}
private boolean writingAManualSpecRunnerIsNecessary() {
return sources.getDirectory().exists() && specs.getDirectory().exists();
}
}