In some circumstances, when using the middleware reporter, the a11y audit completes after test context has been torn down, resulting in test failures due to the thrown errors from using currentURL and currentRouteName. The fix ensures context exists before these two methods are called.
Testing Done
Local tests pass.
Manually validated tests are no longer failing from within the context of a host app.
Summary
In some circumstances, when using the middleware reporter, the a11y audit completes after test context has been torn down, resulting in test failures due to the thrown errors from using
currentURL
andcurrentRouteName
. The fix ensurescontext
exists before these two methods are called.Testing Done