JUnit Jasmine Runner
Features
- Runs Jasmine Tests with JUnit
- Integrates with Eclipse, IntelliJ, Maven etc.
- Uses Java Nashorn JavaScript interpreter
- Optional Browser Support (with Envjs)
- Supports Jasmine 2
Requirements
- Java 8
Usage
Add project dependency. E.g if you use maven:
<dependency>
<groupId>de.helwich.junit</groupId>
<artifactId>junit-jasmine-runner</artifactId>
<version>0.1.4</version>
<scope>test</scope>
</dependency>
Or download from here.
Add Java class (below src/test/java
for maven) which name ends with “Test”. The class specifies the JavaScript test and source files:
import de.helwich.junit.*;
import org.junit.runner.RunWith;
@RunWith(JasmineTestRunner.class)
@JasmineTest(
src = { "Song", "Player" },
test = { "SpecHelper", "PlayerSpec" },
browser = false
)
public class RunJasmineTest {}
By default the tests are expected to be below src/test/js
and the sources below src/main/js
. The default file suffix is .js
.
Release
mvn clean deploy -P release
cd target
jar -cvf bundle.jar junit-jasmine-runner-*
- login here
- Build Promotion > Staging Upload > Artifact Bundle > Select Bundle to Upload
- Build Promotion > Staging Repositories > Select > Release
ToDo
- optionally emit HTML runner