Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to version 4.x leads to test errors #273

Closed
freyjameetsmel opened this issue Jan 22, 2021 · 7 comments
Closed

Upgrade to version 4.x leads to test errors #273

freyjameetsmel opened this issue Jan 22, 2021 · 7 comments

Comments

@freyjameetsmel
Copy link

I'm trying to upgrade ember-router-scroll from v3.3.3 to v4.x in our project. I did the necessary adjustments in the router.js according to the README. The project starts and works as expected.

Some tests however do not run smoothly and thow the following error message:

Assertion Failed: You attempted to remove a function listener which did not exist on the instance, which means you may have attempted to remove it before it was added.

Not sure what causes the issue but it only seems to occur after the version upgrade and following necessary code changes.

@snewcomer
Copy link
Collaborator

👋 Thanks for the issue! I just upgraded ours and did not see this. I'm guessing it is this line. Do you do any funky stuff in a test like patch/override properties on the service?

https://github.com/DockYard/ember-router-scroll/blob/master/addon/services/router-scroll.js#L93

@cah-brian-gantzler
Copy link

cah-brian-gantzler commented Jan 27, 2021

We updated to version 4 and did not get failing tests either, however when I upgraded to ember-qunit 5 I now get the failing tests with the above message. So Im guessing thats the difference.

Whats also weird is for example a test failing it a unit adapter test. One would think ember-router-scroll would not even be instantiated during those tests.

@freyjameetsmel
Copy link
Author

We updated to version 4 and did not get failing tests either, however when I upgraded to ember-qunit 5 I now get the failing tests with the above message. So Im guessing thats the difference.

This is something I need to check tomorrow. I think we did upgrade to ember-unit 5 as well in the last weeks.

@bobisjan
Copy link
Contributor

We have this error after upgrade to the new ember-qunit#5 and @ember/test-helpers#2+ too.

By quick debug I've noticed that destroy() method is called twice during test teardown.

Switching to willDestroy() method seems to be working, but I'm not sure if it is intended/proper fix.

@SergeAstapov
Copy link
Contributor

Potentially fixable via #280

@jherdman
Copy link

jherdman commented Apr 6, 2021

I can confirm #280 resolves this issue. Any chance we could get some eye balls on that PR @snewcomer ? <3

@snewcomer
Copy link
Collaborator

4.0.3!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants