GithubHelp home page GithubHelp logo

Comments (8)

rwjblue avatar rwjblue commented on August 16, 2024

@mitchlloyd - I'm not sure I follow. The PR referenced (#96) made it possible to override services in unit or integration tests (not acceptance tests). In general acceptance tests do not use this repo (or ember-qunit) at all. The functionality in these tests are currently passing in Ember 1.11 and higher.

Can you provide me with an example of what you mean?

from ember-test-helpers.

mitchlloyd avatar mitchlloyd commented on August 16, 2024

If acceptance tests don't use this library then I must be mistaken that this worked in the past. I'm probably just confusing this behavior with component integration tests. Closing this issue.

I would like to do something like what was shown in your "Allow overriding services/factories in the registry" PR in an acceptance test. Something like:

this.application.register('service:analytics', MockAnalyticsService)

But I'm having trouble because of the tricky registry behavior that you documented in the commit message of that same PR. My workaround for now is to handle this stubbing in my production code, but if you can drop any registry knowledge bombs on me please do!

from ember-test-helpers.

rwjblue avatar rwjblue commented on August 16, 2024

@mitchlloyd - The super crappy (but functional) workaround for this in acceptance tests is:

this.application.__deprecatedInstance__.register('service:foo', Ember.Service.extend());

I am actively working on a better solution to bring acceptance tests back into feature parity with integration tests (seems like a constant battle back and forth 😸).

from ember-test-helpers.

mitchlloyd avatar mitchlloyd commented on August 16, 2024

Thanks for that workaround. I appreciate all your hard work that makes my development experience better 👍

from ember-test-helpers.

kylecoberly avatar kylecoberly commented on August 16, 2024

This workaround saved my bacon just now, thank you!

from ember-test-helpers.

 avatar commented on August 16, 2024

Any news on this? Why in acceptance test I can't use simply:

this.application.register("service:notifications", notificationsServiceMock)

instead of:

this.application.__deprecatedInstance__.register("service:notifications", notificationsServiceMock)?

Which is the correct way of doing this?

from ember-test-helpers.

rwjblue avatar rwjblue commented on August 16, 2024

My comment in #124 (comment) is still correct.

from ember-test-helpers.

 avatar commented on August 16, 2024

Ok, I'm using this right now, but how to know if things in future changes? New issue in this repo to subscribe?

from ember-test-helpers.

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.