Coder Social home page Coder Social logo

Comments (15)

rvalle avatar rvalle commented on July 24, 2024

Yes, just found out about it, when thinking about doing my own template, as I need to pass options into Require.js and example would come in handy...

from jasmine-maven-plugin.

ebaxt avatar ebaxt commented on July 24, 2024

I've been planing to document it, but been swamped the last 4 months so I haven't prioritized it I guess. Maybe it would be an idea to link to the example in the mean time? What do you think @searls?

from jasmine-maven-plugin.

chchrist avatar chchrist commented on July 24, 2024

I need to make Jasmine work with RequireJS by following this solution http://japhr.blogspot.co.uk/2011/12/jasmine-testing-of-requirejs-powered.html. Are those two configs safe to use?

from jasmine-maven-plugin.

searls avatar searls commented on July 24, 2024

I'd appreciate documentation for this too. Frankly, I never read the Require.js pull request closely enough to understand it.

@chchrist there's apparently a canned Require.js template. I've never used it / can't vouch for it, but it looks like you can set the specRunnerTemplate parameter to "REQUIRE_JS" https://github.com/searls/jasmine-maven-plugin/blob/master/src/main/java/com/github/searls/jasmine/AbstractJasmineMojo.java -- have you already tried that?

from jasmine-maven-plugin.

chchrist avatar chchrist commented on July 24, 2024

No I didn't know about that. I'll try to see if it works, Thnx!

from jasmine-maven-plugin.

chchrist avatar chchrist commented on July 24, 2024

Is there an example pom.xml to use this template? I am interested in the priority atribute

from jasmine-maven-plugin.

searls avatar searls commented on July 24, 2024

This is the only one I know of.

https://github.com/searls/jasmine-maven-plugin/blob/master/src/test/resources/examples/jasmine-webapp-advanced-requirejs/pom.xml

from jasmine-maven-plugin.

baelter avatar baelter commented on July 24, 2024

Grate examples, but not sufficient imo.
How does other paths relate to customRunnerConfiguration?. It seems to effect scriptLoaderPath.

I'm trying to load require.js from a path specified in scriptLoaderPath and then load a file with customRunnerConfiguration that sets the baseUrl that all my tests should use. Is this not the way to do it?

from jasmine-maven-plugin.

ebaxt avatar ebaxt commented on July 24, 2024

@baelter It's been a while since I wrote this, so my memory might be completely wrong, but I don't think the customRunnerConfig changes the baseUrl. This is the template that's used: https://github.com/searls/jasmine-maven-plugin/blob/master/src/main/resources/jasmine-templates/RequireJsSpecRunner.htmltemplate and it's interpolated with values from the customRunnerConfig which is basically just adding properties to object literal passed to require.config.

There seem to be some interested in this feature, and I'm about to start a new project that will use this feature so I hope to have some time to extend the example and finish up the documentation soon.

from jasmine-maven-plugin.

JHouk avatar JHouk commented on July 24, 2024

FWIW, I would find an example of the usage of customRunnerConfiguration valuable as well. @ebaxt, based on your comment it sounds like the text file should just contain name:val pairs delimited by commas to get incorporated into the require.config() properly? I will try it and see how it goes.

from jasmine-maven-plugin.

JHouk avatar JHouk commented on July 24, 2024

Ok, I've successfully gotten values into the require.config() via the customRunnerConfiguration! I used a text file containing the following code to set a RequireJS dependency path:

paths: {
    "lib" : "target/lib/js/"
}

Now I have a new question: Can anyone think of a way that I can set the value of "lib" in the above example to be "${project.basedir}/target/lib/js/"? If I try to put ${project.basedir} in the configuration text file, it doesn't get updated with the actual value but instead is copied directly into the htmltemplate. Any ideas?

from jasmine-maven-plugin.

searls avatar searls commented on July 24, 2024

Glad you're making progress! A thousand apologies, but this thread is now officially well over my head. I have almost no familiarity with the changes made to customRunnerConfiguration to support Require.js :-/

from jasmine-maven-plugin.

ieugen avatar ieugen commented on July 24, 2024

@JHouk try to use maven-resource-plugin filtering, http://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html.

from jasmine-maven-plugin.

JHouk avatar JHouk commented on July 24, 2024

@ieugen Thank you! I'd been trying to figure out how to set those variables as that has been one of the last (?) big pieces I've needed to figure out about how to use Maven. That should be a huge help!

from jasmine-maven-plugin.

klieber avatar klieber commented on July 24, 2024

These have been documented here: https://github.com/searls/jasmine-maven-plugin/wiki/Spec-Runner-Templates

However please note that this documentation is for the yet to be released 1.3.0.0 version of the plugin. You can monitor the progress of that release here: https://github.com/searls/jasmine-maven-plugin/issues/milestones?direction=asc&page=1&sort=due_date

from jasmine-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.