question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Integration tests breaks for components that inject notifications

See original GitHub issue

Hello !

After upgrading a project from ember 2.11 to 2.13, I noticed that all the integration tests of the components that injects ember-cli-notifications are breaking : Assertion Failed: Attempting to inject an unknown injection: 'service:notification-messages'.

In these components, I inject your addon “individually” via : notifications: Ember.inject.service('notification-messages'),. I also tried to inject via an initializer afterward, and tests are ok with that method. The problem is I don’t need to inject it everywhere, so I shouldn’t use an initializer in my project…

I made a small repo that replicate this problem : https://github.com/Edralo/notification-test-fail

I haven’t looked much to find where the problem is, but maybe it’s linked to https://github.com/emberjs/rfcs/blob/master/text/0150-factory-for.md since the problem appeared with ember 2.12.

That’s pretty much all i know about the issue for now, sorry

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
Matt-Jensencommented, Jun 8, 2017

I was able to clear up the integration test issues with the same approach:

moduleForComponent('my-component', 'Integration | Component | my component', {
  integration: true,
  beforeEach() {
    const notifications = this.container.lookupFactory('service:notification-messages-service');
    this.register('service:notification-messages', notifications);
  }
});
1reaction
mansonacommented, Jan 9, 2020

This has changed with the release of https://github.com/mansona/ember-cli-notifications/pull/251 and shouldn’t be an issue anymore 👍 let me know if you have any questions or are still having problems

Read more comments on GitHub >

github_iconTop Results From Across the Web

What is Integration Testing (Tutorial with ...
Integration testing is done to test the modules/components when integrated to verify that they work as expected i.e. to test the modules which ......
Read more >
Component testing scenarios
A component-under-test doesn't have to be injected with real services. In fact, it is usually better if they are test doubles such as,...
Read more >
Integration testing done right | Blog
Writing integration tests is not always straightforward. By definition, integration tests require interaction between several components, ...
Read more >
Integrated Tests Are A Scam - The Code Whisperer
Integrated tests won't kill you, although the scam remains a problem. ... you use in the broken code path now work correctly together....
Read more >
Integration test fails all unit tests succeed, whats the ...
First you have to determine where the problems are at. Are your unit tests relevant? This includes: Do they have meaningful asserts?
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found