test(context): cover NodeList for include/exclude and fix doc examples#5178
test(context): cover NodeList for include/exclude and fix doc examples#5178cycsmail wants to merge 1 commit into
Conversation
Interesting. What environment are you running where that didn't work? We just switched over to web test runner so I'd like to make sure it's usable for anyone who wants to work in axe-core. |
|
Chrome-for-Testing downloaded fine but the browser wouldn't launch in my container — needed If you want it smoother for container/CI folks, passing |
|
Update — sorted the browser in my container (system libs + |
The
context.mdexamples labeled "Test a Node list" and "Test everything except these DOM nodes" useddocument.querySelector(...), which only ever returns a single node, so they didn't actually show a NodeList. Switched both todocument.querySelectorAll(...)and tweaked the comments so the examples demonstrate the NodeList support that already works. Also added twoContextunit tests: one for a NodeList passed as the bare context, and one for NodeLists passed viainclude/exclude. (doc/API.mdalready lists NodeList as an accepted context, so it didn't need a change.)Heads up: I couldn't get the browser test runner going in my environment, so the new assertions were checked against the built
axe.jsbundle under jsdom rather than web-test-runner — prettier and eslint are clean. Worth a CI run to confirm in-browser.Closes: #3348