Code Monkey home page Code Monkey logo

Comments (9)

themindfuldev avatar themindfuldev commented on July 17, 2024

0f08451

from marionette-ref-impl.

joseph-jja avatar joseph-jja commented on July 17, 2024

I don't think we need to do the setTimout() in the before each, jasmine 1.x has a way to do this that we are not using. It uses the waits(). So if you are seeing setTimeout then the test is not being done correctly.

from marionette-ref-impl.

themindfuldev avatar themindfuldev commented on July 17, 2024

with Jasmine 2.0 there is an even better approach than using waits(), they have a done callback: this new approach is described at Upgrading Jasmine - Asynchronous Specs

However my approach here is to require the module outside of the describe and then we would need no async feature at all :)

Like this: https://github.com/brendajin/marionette-ref-impl/blob/0f08451156944e1eec5dfd3cb835011407b37fb8/test/base/application.spec.js

from marionette-ref-impl.

joseph-jja avatar joseph-jja commented on July 17, 2024

Same thing, different name. Grunt actually does async with the done() and it can be problematic.

from marionette-ref-impl.

themindfuldev avatar themindfuldev commented on July 17, 2024

The advantage of using done is that if we have more than 1 callback they don't have to be nested, but they would be flattened instead by doing one block for each precondition. In order to ease that I have authored a very simple preCondition instruction for Jasmine 2.0's way of async testing: https://github.com/tiagorg/jasmine-precondition and also on NPM.

However for this case here, if we are able to use requireJS outside of the test we won't need to go down on this path. That would be cleaner I suppose

from marionette-ref-impl.

joseph-jja avatar joseph-jja commented on July 17, 2024

Are you using jasmine 2.0 or 2.1?

from marionette-ref-impl.

themindfuldev avatar themindfuldev commented on July 17, 2024

2.1, just noticed the title saying 2.0. We are using the latest to see how would it be like.

from marionette-ref-impl.

themindfuldev avatar themindfuldev commented on July 17, 2024

unified karma's and main's require-config here: f27b750

from marionette-ref-impl.

themindfuldev avatar themindfuldev commented on July 17, 2024

Improving the specs for application: a411bec

from marionette-ref-impl.

Related Issues (13)

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.