All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.searls.jasmine.GenerateManualRunnerMojo Maven / Gradle / Ivy

Go to download

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

There is a newer version: 1.1.2
Show newest version
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();
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy