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(prefer-in-document): check that argument exists before accessing #242

Merged
merged 1 commit into from
Dec 26, 2021

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Dec 26, 2021

What:

Fixes a crash caught by #229 in prefer-in-document

Why:

It assumes that expect calls have an argument, which semantically they should but syntactically is not correct.

How:

I've implemented a guard to ensure that the argument exists before trying to access any properties on it; have also added the test to the valid tests for every rule to ensure they can all handle the case.

Checklist:

  • Documentation N/A
  • Tests
  • Ready to be merged

@codecov
Copy link

codecov bot commented Dec 26, 2021

Codecov Report

Merging #242 (818691e) into main (03f8df9) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##              main      #242   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           15        15           
  Lines          558       560    +2     
  Branches       155       156    +1     
=========================================
+ Hits           558       560    +2     
Impacted Files Coverage Δ
src/rules/prefer-in-document.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 03f8df9...818691e. Read the comment docs.

@benmonro benmonro merged commit e8cefd3 into main Dec 26, 2021
@benmonro benmonro deleted the check-argument-exists branch December 26, 2021 08:22
@github-actions
Copy link

🎉 This PR is included in version 3.9.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants