Comments (9)
Apologies for not getting back to you -- jetty was added to the project only very recently. Prior to that I really didn't want to add a server at all, which is why jasmine:test (still) loads scripts over the file protocol.
However, HtmlUnit seems to really not care about the AJAX over file:/, in fact I've seen several projects that perform AJAX locally. It's probably the case that extjs includes some edge case that HtmlUnit can't handle.
In any case, hopefully in the near future I'll be able to address this by spinning up Jetty again for jasmine:test and making the executor pluggable.
from jasmine-maven-plugin.
I am having the same problem. When running mvn jasmine:test, the files are deployed to my project's /target/jasmine/src and /target/jasmine/spec directories. When running mvn jasmine:bdd, The files are deployed to jetty with the relative path from the root of my webapp. ie: localhost:8234/web/WEB-INF/js-src and localhost:8234/web/WEB-INF/js-test. Because I am using requireJS with a configuration that points to paths, I am required to add the plugin twice to my pom to do mvn builds and TDD. One configuration for the bdd goal that excludes the test goal config file, and one configuration for test that excludes the bdd goal config file. Can I have different excludes for different goals in one pom plugin declaration? Here is a snippet from my resulting pom:
<plugins>
<plugin>
<groupId>com.github.searls</groupId>
<artifactId>jasmine-maven-plugin</artifactId>
<version>1.0.2-beta-5</version>
<executions>
<execution>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
<configuration>
<jsSrcDir>web/WEB-INF/js-src</jsSrcDir>
<jsTestSrcDir>web/WEB-INF/js-test</jsTestSrcDir>
<customRunnerTemplate>web/WEB-INF/js-test/jasmine-template.html</customRunnerTemplate>
<specExcludes>
<exclude>**/*Test.js</exclude>
<exclude>**/jasmine-bdd-test-config.js</exclude>
</specExcludes>
<sourceExcludes>
<exclude>LNM-Main.js</exclude>
<exclude>jasmine-config.js</exclude>
<exclude>factory.js</exclude>
<exclude>control/*.js</exclude>
<exclude>model/*.js</exclude>
<exclude>view/*.js</exclude>
</sourceExcludes>
</configuration>
</plugin>
<plugin>
<groupId>com.github.searls</groupId>
<artifactId>jasmine-maven-plugin</artifactId>
<version>1.0.2-beta-5</version>
<executions>
<execution>
<goals>
<goal>bdd</goal>
</goals>
</execution>
</executions>
<configuration>
<jsSrcDir>web/WEB-INF/js-src</jsSrcDir>
<jsTestSrcDir>web/WEB-INF/js-test</jsTestSrcDir>
<customRunnerTemplate>web/WEB-INF/js-test/jasmine-template.html</customRunnerTemplate>
<specExcludes>
<exclude>**/*Test.js</exclude>
<exclude>**/jasmine-mvn-test-config.js</exclude>
</specExcludes>
<sourceExcludes>
<exclude>LNM-Main.js</exclude>
<exclude>jasmine-config.js</exclude>
<exclude>factory.js</exclude>
<exclude>control/*.js</exclude>
<exclude>model/*.js</exclude>
<exclude>view/*.js</exclude>
</sourceExcludes>
</configuration>
</plugin>
</plugins>
from jasmine-maven-plugin.
gantaa,
Whether this is the right way to use profiles or not, I am using profiles to configure the plugin differently. I still don't have jasmine:test working like I want yet, but am doing a lot of bdd now. So when I run jasmine, I just pass in the profile to mvn like
mvn jasmine:bdd -PjasmineBdd
or
mvn jasmine:test -PjasmineTest
from jasmine-maven-plugin.
I've written a blog on how to work-around this issue. You can read it here: http://blog.jayway.com/2012/04/17/configuring-jasmine-to-work-with-maven-and-jquery-fixtures/
from jasmine-maven-plugin.
@johanhaleby Part of the reason I don't care to spend much time on this issue is that I don't believe unit tests should read from the file system or talk over the network; if they don't, this isn't an issue, right? Is anyone experiencing problems for reasons other than this?
In particular, I think jasmine-jquery's functionality of loading fixtures from external files is a really bad idea and would suggest folks set up their fixtures within their specs (to do so succinctly, I wrote jasmine-fixture).
from jasmine-maven-plugin.
@searls - Early in the project when I was integrating Jasmine and Extjs we really only worked in "development mode". During development mode, Extjs loads it's hundreds of components dynamically depending on what's required. This works great with jasmine:bdd but not with jasmine:test because of the "file:" protocol issue.
This may NOT be a problem for us now that we have finally implemented "production mode" and all our javascript gets aggregated and doesn't use any dynamic loading of components. So I'm thinking jasmine:test running our aggregated/compressed javascript should be fine. I'll let you know.
from jasmine-maven-plugin.
@dehru so Extjs's dependency loading mechanism was the culprit? I've never really used itβis flicking on "production mode" a non-trivial thing for an extjs user to do?
from jasmine-maven-plugin.
@searls - If memory serves me correctly from 7 months ago I think I determined that was the culprit. In order to turn on production mode, Sencha (creators of Extjs) provide a build tool which we had not integrated yet at the time I originally posted this. I wouldn't say it's non-trivial for an extjs user, but I would expect every production Extjs app to integrate it early in development. I'm hoping next week I can try to resurrect jasmine:test from the dead on this project and let you know if that has solved our problem.
from jasmine-maven-plugin.
This should now be resolved by pull request #145
from jasmine-maven-plugin.
Related Issues (20)
- Jasmine-Maven plugin error in Windows platform HOT 1
- antlr error HOT 1
- ReferenceErrors when running in Jenkins with symlinked JENKINS_HOME HOT 3
- How to use phantomjs 2.1.1 HOT 1
- Jenkins Maven Integration with Jasmine broken since 2.2 (Test results not shown) HOT 2
- Cannot make it work with ManualSpecRunner HOT 2
- Allow users to configure tests to run in a random order HOT 2
- turnoff the default reports generated by this plugin and print only the custom reporter messages HOT 1
- Can't customize ChromeDriver on 3.0-alpha-01 HOT 2
- Update the github pages site HOT 1
- Unable to set WebDriver IE specific capability ignoreProtectedModeSettings HOT 2
- Chrome version 74 HOT 4
- The documentation page is down HOT 3
- Blocked testing with latest version HOT 11
- Cannot make it work with RemoteWebDriver and Docker HOT 5
- timeout error after waiting for 300 sec with version 3.0-beta-01 HOT 2
- jasmine:bdd (version 3.0-beta-01) opens browser but jetty gives 403 HOT 3
- Broken link for usage page HOT 2
- The link to documentation at github is broken. HOT 5
- plugin doesn't work with Chrome version 117 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jasmine-maven-plugin.