wgroeneveld / jasmine-junit-runner Goto Github PK
View Code? Open in Web Editor NEWA custom JUnit Java Runner annotation to run headless Javascript tests embedded in your IDE
License: MIT License
A custom JUnit Java Runner annotation to run headless Javascript tests embedded in your IDE
License: MIT License
I ran "mvn package" and I got the following error:
Running be.klak.env.EnvUtilsTest
[ Envjs/1.6 (Rhino; U; Windows 7 x86 6.1; en-US; rv:1.7.0.rc2) Resig/20070309 PilotFish/1.2.13 ]
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.721 sec <<< FAILURE!
initializationError(be.klak.env.EnvUtilsTest) Time elapsed: 0.005 sec <<< ERROR!
org.mozilla.javascript.EvaluatorException: Couldn't read source file "src/test/javascript/envJsOptions.js": src\test\javascript\envJsOptions.js (The system cannot find the path specified). (script#1)
at org.mozilla.javascript.tools.ToolErrorReporter.runtimeError(ToolErrorReporter.java:111)
Any plans to add support for PhantomJS, or else make the javascript engine plugable?
Hi jefklak,
happy to find your project here as an alternative to the jasmine-maven-plugin. I tried to setup everything into my project. I configured my Test class - I think correctly:
@RunWith(JasmineTestRunner.class)
@JasmineSuite(sources = { "lib/jquery-1.7.1.js", "lib/underscore.js", "lib/require-jquery.js", "lib/backbone.js","lib/bootstrap.js", "main.js" }, specs = {"my.spec.js"}, generateSpecRunner = true, sourcesRootDir = "src/main/javascript")
public class MyTest {
...
}
As you can see my specs are depending on some 3rd party stuff.
When I run it, the CLI tells me the following:
[ Envjs/1.6 (Rhino; U; Windows 7 x86 6.1; en-US; rv:1.7.0.rc2) Resig/20070309 PilotFish/1.2.13 ]
failed to open file file://C/:/projectRoot/api/data.js JavaException: java.net.UnknownHostException: C
js: syntax error
js:
JavaException: java.net.UnknownHostException: C
Now there are two problems with that, which I don't know how to resolve:
I really hope you can point me to something. Let me know if you need my contributions or the like?
Best regards and thank you in advance!
Hi, Wouter! I discovered your Jasmine JUnit code a couple of days ago and I'm very impressed. I have a couple of pull requests I'm going to send your way that make using the library much easier by packaging all of the resources into the jar, rather than copying the Jasmine and EnvJS stuff into each dependent project. I'm wondering if you'll be deploying this project to the Maven Central repository. I think it's in a very usable state!
Hi,
I found your jasmine runner pretty interesting. I tried upgrading the jasmine version to 2.0, but something went wrong. Have someone ever tried it before?
Thank you
First of all, I should say I'm very excited at the prospect of being able to run jasmine tests along with junit tests. Thank you for developing this plugin!
I'm trying to build the project locally (from master) and encountering some test failures. I'm getting this exception:
useJasmineRunnerOnJasmineTestRunnerBeforeAndAfterClass(be.klak.junit.jasmine.JasmineTestRunnerBeforeAndAfterTest)
Time elapsed: 0.127 sec <<< ERROR!
java.lang.RuntimeException: Exception while firing After method: runMijAfterOok
at be.klak.junit.jasmine.JasmineTestRunner.fireMethodsWithSpecifiedAnnotationIfAny(JasmineTestRunner.java
:206)
at be.klak.junit.jasmine.JasmineTestRunner.run(JasmineTestRunner.java:170)
at be.klak.junit.jasmine.JasmineTestRunnerBeforeAndAfterTest.useJasmineRunnerOnJasmineTestRunnerBeforeAnd
AfterClass(JasmineTestRunnerBeforeAndAfterTest.java:21)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
at org.mockito.internal.runners.JUnit45AndHigherRunnerImpl.run(JUnit45AndHigherRunnerImpl.java:37)
at org.mockito.runners.MockitoJUnitRunner.run(MockitoJUnitRunner.java:62)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at be.klak.junit.jasmine.JasmineTestRunner.fireMethodsWithSpecifiedAnnotationIfAny(JasmineTestRunner.java
:200)
... 33 more
Caused by: java.lang.AssertionError: unexpected element(s):<[0]> in <[0, 1]>
at org.fest.assertions.Fail.failure(Fail.java:228)
at org.fest.assertions.Assert.failure(Assert.java:149)
at org.fest.assertions.ItemGroupAssert.failureIfUnexpectedElementsFound(ItemGroupAssert.java:107)
at org.fest.assertions.ItemGroupAssert.assertContainsOnly(ItemGroupAssert.java:79)
at org.fest.assertions.ObjectGroupAssert.containsOnly(ObjectGroupAssert.java:65)
at be.klak.junit.jasmine.classes.JasmineTestRunnerBeforeAndAfterClass.runMijAfterOok(JasmineTestRunnerBef
oreAndAfterClass.java:30)
... 38 more
My machine is running windows 7. I'm getting this error after downloading the repo and executing:
mvn clean install
Please advise.
Alternatively, is there a mirror that this dependency can be downloaded from so that I don't have to build locally?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.