Giter Site home page Giter Site logo

Comments (5)

ike18t avatar ike18t commented on May 17, 2024

Nothing obvious comes to mind when looking at your example. What version of ng-mocks are you currently using with your Angular 4 app? If you are on v8 I'd recommend downgrading to v7 but I'm not exactly sure if that is your problem or not. Do you mind trying to reproduce the issue in stackblitz or somewhere I have access?

from ng-mocks.

iranicus avatar iranicus commented on May 17, 2024

Yeah sure, will sort out a stackblitz now, see if I can replicate it.

from ng-mocks.

iranicus avatar iranicus commented on May 17, 2024

Hello again, managed to replicate the issue in a stackblitz,:
https://stackblitz.com/edit/angular-testing-dfdy1u

I updated the package.json to include the versions we are using with angular, jasmine, karma, typescript & of course ng-mocks (7.8.0). BTW a change, in that we use ng-bullet with our testbed build which is wrapped in the configureTestSuite() instead of the usual BeforeEach(async()). I have found that without using this though we still get the same errors (see the colour.component.spec.ts commented out code for the default testbed approach) so I don't think its an issue with using that.
I updated the original code in this ticket with using this too, also having checked some of the closed issues, I noticed one of the other errors that gets shown is Cannot read property 'annotations' of undefined which I'm not sure if this is the cause of the illegal state error. Anyway this was reported for issue #42 which was fixed so not sure if this is just another one of those cases.

UPDATE: One thing I have noticed is as soon as I update the version of Angular to 5 in the stackblitz the error goes away which points to an incompatibility with Angular 4.

UPDATE2: So I have checked the package.json in the earliest version of the code being tagged at 5.0.0-rc1 and it appears it depends on @angular/[email protected] as a peer dependency when we are running @angular/[email protected]. Am I right in therefore assuming that Angular 4 is not supported?
ty

from ng-mocks.

ike18t avatar ike18t commented on May 17, 2024

Hi @iranicus

Sorry for the much delayed response. You are correct that ng-mocks doesn't support Angular 5...I totally forgot about that. I believe that the old 0.7.0 version of mock-component has angular 4 support. For some reason stack blitz isn't allowing me to install deps so I was not able to try it out for myself.

from ng-mocks.

iranicus avatar iranicus commented on May 17, 2024

Hello there @ike18t
For the moment I have manually created my own mock components which do the job, we are planning on updgrading to Angular 8 however early next year. When that happens we will likely switch over to ng-mocks after I've trial ran it again when the time comes. Thanks now.
Richard

from ng-mocks.

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.