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

Fix failing tests in the main branch #941

Merged
merged 3 commits into from Aug 11, 2023
Merged

Conversation

jessebeach
Copy link
Collaborator

There are a few failing tests in the main branch and this fixes them.

This PR also pegs aria-query to version 5.1.2.

@jessebeach jessebeach requested a review from ljharb June 24, 2023 23:20
@codecov
Copy link

codecov bot commented Jun 24, 2023

Codecov Report

Merging #941 (eadd70c) into main (f0d2ddb) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #941   +/-   ##
=======================================
  Coverage   99.29%   99.29%           
=======================================
  Files         104      104           
  Lines        1554     1554           
  Branches      522      522           
=======================================
  Hits         1543     1543           
  Misses         11       11           
Files Changed Coverage Δ
src/rules/mouse-events-have-key-events.js 100.00% <ø> (ø)

@jessebeach jessebeach force-pushed the fix-main-branch-failing-tests branch from ad78c86 to 3bac0f7 Compare June 24, 2023 23:25
package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@ljharb ljharb force-pushed the fix-main-branch-failing-tests branch 2 times, most recently from 56b06de to 5749b1b Compare June 25, 2023 19:34
@jessebeach jessebeach force-pushed the fix-main-branch-failing-tests branch from 5749b1b to 1d4eac1 Compare July 4, 2023 18:42
@jessebeach
Copy link
Collaborator Author

Finally found some time (and focus) on a flight to get back to this.

@jessebeach jessebeach force-pushed the fix-main-branch-failing-tests branch from 1d4eac1 to 26e8e19 Compare July 4, 2023 18:52
.npmrc Outdated
@@ -1,3 +1,4 @@
package-lock=false
allow-same-version=true
message=v%s
audit-level=low
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just testing a theory.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ljharb I'm going to need help with this one. It seems we're in a bind. We can't update semver because of this package's commitment Node 4 support. Here are some options

  1. We could turn off the posttest checks for now, until the Node 4 is no longer supported in this project and semver can be updated.
  2. Comment out the usages of semver in the project -- which means our test coverage for optional chaining is reduced -- and remove the dependency.
  3. Update semver and drop Node 4 support.
  4. Move the test cases that are wrapped in the semver check to their own folder and configure ESLint to only run on them if the version of ESLint is greater than v6.

I'm going to try #4, but I'm on a plane right now and internet is spotty, so please ignore some thrash in the PR as I use it to test out some theories.

Copy link
Member

@ljharb ljharb Jul 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't worry about the posttest tests due to the semver false positive CVE - if that's the only failure, i can take care of that. There's still a bunch of failing node tests tho.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, if you rebase on top of #944 instead of main, then that should address the problem :-) that way i can merge both PRs at once once the other tests are passing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do

@@ -340,6 +339,7 @@ const neverValid = [
{ code: '<style onClick={() => {}} />;', errors: [expectedError] },
{ code: '<sub onClick={() => {}} />;', errors: [expectedError] },
{ code: '<sup onClick={() => {}} />;', errors: [expectedError] },
{ code: '<summary onClick={() => {}} />;', errors: [expectedError] },
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this test adjustment is right, this may be an issue in axobject-query: A11yance/axobject-query#319

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dummdidumm ya, I think you're right. This is a tricky one. More details here: https://html.spec.whatwg.org/multipage/interactive-elements.html#the-summary-element

Given that we need to know the rendered output to make a determination about this element's role and behavior, the best course of action for a static linter is to be permissive of either state - an interactive element or a generic (static) element. I'll get this updated when I do a proper update of aria-query for ARIA 1.3.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dummdidumm #656 to tracks this.

@karlnorling
Copy link

@jessebeach - update on this? I'm waiting to update due to the semver being in dependencies it triggers security warning https://security.snyk.io/vuln/SNYK-JS-SEMVER-3247795 for semver.

I noticed it's in #944 also. Maybe we shouldn't combine the PRs and have #944 merged first?

@ljharb
Copy link
Member

ljharb commented Aug 11, 2023

@karlnorling semver v5, v6, and v7 all have patches that fix that issue, so nobody should need to do anything except end users updating their lockfiles.

@ljharb ljharb force-pushed the fix-main-branch-failing-tests branch 2 times, most recently from 4e7c7b9 to b32d046 Compare August 11, 2023 19:48
@ljharb
Copy link
Member

ljharb commented Aug 11, 2023

Looks like axe-core broke us too: dequelabs/axe-core#4127

@ljharb ljharb force-pushed the fix-main-branch-failing-tests branch from b32d046 to 8d8f016 Compare August 11, 2023 20:03
@ljharb
Copy link
Member

ljharb commented Aug 11, 2023

Last 2 failing tests seem to be about error messages for two tests showing up in the wrong order. I can't reproduce them locally, consistently.

…node

This has the side benefit of making the error message ordering consistent, since when both were on the JSXOpeningElement, since eslint/node combinations ordered the errors inconsistently
@ljharb ljharb merged commit eadd70c into main Aug 11, 2023
168 checks passed
@ljharb ljharb deleted the fix-main-branch-failing-tests branch August 11, 2023 22:35
@jessebeach
Copy link
Collaborator Author

@jessebeach - update on this?

@karlnorling, @ljharb merged it yesterday.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants