ember-a11y / ember-a11y-testing

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

Basic build failures #245

Open frykten opened 3 years ago

frykten commented 3 years ago

Hello!

I am doing very basic and naive testing to see if this addon could be useful for our app. When starting a new app with the very useful and basic ember-new-output it sometimes seems like there are discrepancies with the stack... (or at least the doc is not entirely true/filled).

More info (all tests are made with this addon current version, i.e. 4.0.2): First error: Ember-cli: 3.24.0, nothing more, nothing else, the basic testing runs fine, the basic app runs fine. When I add this, the ember test does not build and gives:

Build Error (broccoli-persistent-filter:Babel > [Babel: @ember-data/adapter]) in @ember-data/adapter/rest.js
[...]/ember-a11y-testing/@ember-data/adapter/rest.js: Imported DEPRECATE_NAJAX from @ember-data/private-build-infra/deprecations which is not a supported flag.

As a matter of fact, if I remove ember-data, no issues, it works just fine.

Second error: Ember-cli: 3.20.2, same setup, no issues. When I add this, no issues. When I try to use the setupGlobalA11yHooks method as shown (and working in ember-cli: 4.24.0), it still builds. However, nothing works because:

Uncaught TypeError: (0 , _testHelpers._registerHook) is not a function
    at setup-global-a11y-hooks.js:20

Presently looking like an error with @ember/test-helpers, which I tried to use with the latest version (currently 2.2.3) and with the latest needed following the Readme (2.0.0). Same problem, always. If I go lower than the needed version, of course, there's an error due to not having the right dependencies.

rwjblue commented 3 years ago

Hmm, that first error seems unrelated to this addon (looks like a bug that was reported a while back on ember-data that has to do with preserved cache after updating/changing ember-data versions).

RE: the second error, can you share the full stack trace (or even just the error message)? It's quite difficult to reason about with just that one line number...

frykten commented 3 years ago

Sorry, I messed up the Markdown... The error log, followed by the beginning of the stacktrace (should be easier to ready with both) is

Uncaught TypeError: (0 , _testHelpers._registerHook) is not a function
    at setup-global-a11y-hooks.js:20
rwjblue commented 3 years ago

Hmm, maybe you are not testing with @ember/test-helpers@2.0.0 or higher?

frykten commented 3 years ago

Nono: tried with @ember/test-helpers@2.2.3, @ember/test-helpers@2.0.0 and we get this error. When removing the import, we get the righteous "need @ember/test-helpers@2.0.0 or higher"-kinda message. Same with a new light project or an old heavy one (like the one we have at work).

I'll try to find time this week to debug a tad if other stacks work/don't.

rwjblue commented 3 years ago

Ya, seems like that might be necessary. @ember/test-helpers definitely has that function exported from its entry point from 2.0.0 and higher.

https://github.com/emberjs/ember-test-helpers/blob/v2.0.0/addon-test-support/@ember/test-helpers/index.ts#L26

Maybe there are multiple versions of @ember/test-helpers installed and the older version is clobbering the newer version?

scalvert commented 3 years ago

Ya a yarn why @ember/test-helpers would help here.

ctcpip commented 3 years ago

ember-qunit didn't update to 2.0 of test-helpers until version 5

├── @ember/test-helpers@2.2.5 
└─┬ ember-qunit@4.6.0
  └── @ember/test-helpers@1.7.3
scalvert commented 3 years ago

I think you probably don't want to mix and match these. You'll want to be on ember-qunit@~5.x and @ember/test-helpers@~2.x. You can follow this guide to migrate.

ctcpip commented 3 years ago

I think you probably don't want to mix and match these. You'll want to be on ember-qunit@~5.x and @ember/test-helpers@~2.x. You can follow this guide to migrate.

well it's impossible to mix and match them. the build fails. this project needs to update the requirements to mention that qunit 5.x is required, which currently it says nothing about. furthermore, the changelog should mention this is a breaking change for v4. I may submit a PR for that, but I can't right now.

acorncom commented 1 week ago

Is this still an issue? I've used ember-a11y-testing on multiple apps in the last year without problems. Seems like we could probably close?