Coder Social home page Coder Social logo

Karma/Jasmine test Failing about ng-idle HOT 1 CLOSED

moribvndvs avatar moribvndvs commented on July 19, 2024
Karma/Jasmine test Failing

from ng-idle.

Comments (1)

moribvndvs avatar moribvndvs commented on July 19, 2024

First, let's talk about the second issue, not being able to get ng-idle-test to run. Let's imagine this scenario (I just ran through it, so this is an actual example, not theoretical):

I clone ng-idle-test and run npm install. It pulls down Node packages and then gets to the bower install part and walks the dependency tree. It sees that the project's bower.json as a bunch of Angular modules listed with the version ~1.3 (which means "any version starting with 1.3"). It looks at ng-idle 0.3.5 and sees that it requires Angular ~1.2. Everything else needs ~1.3. It'll stop and ask you what you want to do, install the latest 1.2 or the latest 1.3? Naturally, since you know your other project is 1.2, you might say to use 1.2. It does pull down Angular 1.2, but unfortunately, all the ancillary Angular modules we listed as dependencies are still the 1.3 versions of those Angular modules (cookies, animate, resource, mock, etc.). Bower has no way of knowing that all those other Angular modules should be downgraded to a version that is compatible with Angular 1.2.x. Anyways, you're unaware that this happened, so you run grunt test and see that it failed with the line Unknown provider: $$qProvider <- $$q <- $interval <- $idle. As I've been building up to, this error is because you have some other module loaded that is incompatible with either Angular or another Angular module. In this case, I think it's because we tried to use Angular Animate 1.3 with Angular 1.2. The fix, in this case, is to change the required version of all those Angular modules to ~1.2 (the easiest way is to probably just delete bower_components and edit bower.json and replace 1.3 with 1.2, then run bower install again). Once it's fixed, run grunt test and you'll see it completes successfully.

As to your main question, I don't know if the trouble you had in ng-idle-test is related to the issue you're having in your project. You can start by looking at your bower.json file to see if you have any obvious version mismatches like we discussed above (you can attach the relevant lines in your bower.json file here, if you are really lost). Another thing to do is look at all your dependencies and make sure they don't require a different version of a component than you already have (ng-idle works with 1.2 and 1.3, BTW, so it shouldn't be that module). You can also try linking me to (or privately sending me) your test and this PayBeneficiary.js, or your repo itself so I can look for issues.

from ng-idle.

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.