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.

Fix link-to-external for integration tests

See original GitHub issue

Since link-to-external is currently registered manually, integration tests that test components using link-to-external wind up having problems since it can’t be resolved.

One current solution is for developers to manually import the component and register it, which requires reaching into the -private internals of ember-engines (obviously non-ideal).

I’m unsure of the best way to solve this issue. My thinking currently is that the best way would be to enable ember-engines/resolver to have knowledge of resolving it’s special components (currently only the modified link-to and link-to-external).

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:16 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ezycommented, Jan 29, 2021

Having come from working on Jest where common methodology is stubbing components that are dependancies but not required in the test, I followed the same approach in my Ember integration test. Was a nice easy way to get around the error.

hooks.beforeEach(function() {
    const externalLinkStub = class LinkToExternalComponent extends Component {};
    this.owner.register('component:link-to-external', externalLinkStub);
});
1reaction
nickiaconiscommented, Sep 12, 2016

I tried the suggested workaround, like so:

import LinkToExternalComponent from 'ember-engines/-private/link-to-external-component';

module('my-component', 'Integration | Component | my-component', {
  beforeEach() {
    this.registry.register('component:link-to-external', LinkToExternalComponent);
  },
});

which alleviates the assertion failure:

Assertion Failed: A helper named ‘link-to-external’ could not be found

but results in a type error:

TypeError: owner._getExternalRoute is not a function

being thrown from line 16 of the link component:

https://github.com/dgeb/ember-engines/blob/master/addon/-private/link-to-external-component.js#L16

Read more comments on GitHub >

github_iconTop Results From Across the Web

LTI: Creating a deep link to external service usin...
We have the data we need to pass in the integration id field of all users in our instance but I'm a bit...
Read more >
Getting Integration Testing Right - Semaphore CI
An integration test verifies components' interaction with the external system (database, message queue, etc.). Integration tests may affect each ...
Read more >
Use Easy-Fix to Run Integration Tests Like Unit Tests - Medium
Easy-fix facilitates a single set of integration tests that can run live, capturing the data that passes between the target components, ...
Read more >
Pega Knowledge Sharing
Things you need to do when you want to Integrate Pega Knowledge with the ... power supply 99956035 negative pregnancy test 2 weeks...
Read more >
epic care connect
Care Everywhere is natively integrated into the Epic EHR and does not require a separate ... It's comprehensive, tested, and ready-to-roll – backed...
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