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 (v4) #494

Merged
merged 1 commit into from
Feb 2, 2023

Conversation

drewlee
Copy link
Contributor

@drewlee drewlee commented Feb 2, 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 added the bug label Feb 2, 2023
@drewlee drewlee marked this pull request as ready for review February 2, 2023 23:29
@drewlee drewlee merged commit d3d35ae into backport-release-v4 Feb 2, 2023
@drewlee drewlee deleted the drewlee/test-helpers-fix-v4 branch February 2, 2023 23:30
@drewlee drewlee changed the title Fixes currentRouteName middleware reporter test failures Fixes currentRouteName middleware reporter test failures (v4) Feb 2, 2023
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.

None yet

1 participant