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

Fixes currentRouteName middleware reporter test failures #491

Merged
merged 2 commits into from
Feb 2, 2023

Conversation

drewlee
Copy link
Contributor

@drewlee drewlee commented Feb 1, 2023

Fixes issue #489.

The recent release of @ember/test-helpers v2.9.0 added an assertion error that is emitted if the route name isn't available for a particular test. This results in a slew of unrelated application test failures when running the middleware reporter.

The resulting test failures typically consist of:

Promise rejected during "clicking the View Permissions button brings up the View modal": Assertion Failed: currentRouteName shoudl be a string"Source:
Error: Assertion Failed: currentRouteName shoudl be a string
    at assert (http://localhost:4444/talent/assets/vendor-static.js:32729:15)
    at currentRouteName (http://localhost:4444/talent/assets/test-support.js:22729:75)
    at middlewareReporter (http://localhost:4444/talent/assets/test-support.js:32566:61)
    at async http://localhost:4444/talent/assets/test-support.js:32499:11
    at async Promise.all (index 0)
    at async Object.<anonymous> (http://localhost:4444/talent/assets/tests.js:32489:7)"

The fix introduces a loose wrapper around the currentRouteName call, which absorbs the error, preventing it from getting emitted up to the test scope. All other behavior remains unchanged.

@drewlee drewlee force-pushed the drewlee/test-helpers-fix branch from d754df1 to cfda25e Compare February 1, 2023 22:45
@drewlee drewlee added the bug label Feb 1, 2023
@drewlee drewlee changed the title [WIP] Fixes currentRouteName middleware reporter test failures Fixes currentRouteName middleware reporter test failures Feb 1, 2023
@drewlee drewlee marked this pull request as ready for review February 1, 2023 23:08
@drewlee drewlee requested a review from scalvert February 1, 2023 23:09
Copy link
Contributor

@scalvert scalvert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems unfortunate that this breaking change caused such a downstream affect. Thanks for fixing!

@drewlee drewlee merged commit 6cce3ec into master Feb 2, 2023
@drewlee drewlee deleted the drewlee/test-helpers-fix branch February 2, 2023 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants