ember-a11y / ember-a11y-testing

A suite of accessibility tests that can be run within the Ember testing framework
MIT License
137 stars 50 forks source link

`setup-middleware-reporter.d.ts` is causing typescript errors in consuming apps when updating to v5.2.0 #502

Closed robostheimer closed 1 year ago

robostheimer commented 1 year ago

My team recently updated ember-a11y-testing to v 5.2.0 and we began to see typescript errors emanating from ember-a11y-testing/test-support/setup-middleware-reporter.d.ts

node_modules/ember-a11y-testing/test-support/setup-middleware-reporter.d.ts:1:23 - error TS2688: Cannot find type definition file for 'ember__test-helpers'.

1 /// <reference types="ember__test-helpers" />

In our tests, rolling back to v5.1.0 solves the issue.

It appears to have something to do with the use of currentRouteName in https://github.com/ember-a11y/ember-a11y-testing/compare/v5.1.0...v5.2.0#diff-2b7b86d547afb814ffca762b5a1162f99ed0f3fbf12e23bd59ed82343d6270e4R48

chriskrycho commented 1 year ago

Thanks for reporting this! This package needs to update to use the official types from that package rather than shipping its own! I think it should be more or less just a matter of making sure this library is using the latest version of @ember/test-helpers and then removing the custom definition I linked there, but I have not checked out the repo to confirm that.

robostheimer commented 1 year ago

That's what we thought was going on given that ember__test-helpers is deprecated and essentially just a placeholder.

robostheimer commented 1 year ago

Wondering if we can get an update on this. Starting to block a migration I'm working on.

robostheimer commented 1 year ago

PR to fix: https://github.com/ember-a11y/ember-a11y-testing/pull/503

drewlee commented 1 year ago

This is pretty much a duplicate of issue #498, which hinges on a new release of @ember/test-helpers which incorporates the changes in PR #1344.

robostheimer commented 1 year ago

This issue and likely #498 are fixed now. Closing this issue now.