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

Refactor: rename matcher.js to create-matcher.js #88

Merged

Conversation

mroderick
Copy link
Member

This PR renames the poorly named function match in matcher.js to createMatcher in create-matcher.js, which better describes what the function does.

It is already exported as samsam.createMatcher, so no new release is required.

Background

I am trying to cover this library in JSDoc comments, understanding what this function does has always been a struggle.

This has been unlocked by #84, which fixed is-element.test.js to not fail when load order changes.

This PR paves the way for #82

Solution

Rename the file(s) and the name of the function that is exported (not the name it is exported under though).

How to verify - mandatory

  1. Observe that tests still pass

Checklist for author

  • npm run lint passes
  • References to standard library functions are cached.

Using a descriptive name helps make the code easier to understand

The function is already exported as samsam.createMatcher
@mroderick mroderick force-pushed the rename-matcher-to-create-matcher branch from 73a9554 to 1329ceb Compare August 31, 2019 15:35
@codecov
Copy link

codecov bot commented Aug 31, 2019

Codecov Report

Merging #88 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #88   +/-   ##
=======================================
  Coverage   98.52%   98.52%           
=======================================
  Files          17       17           
  Lines         473      473           
=======================================
  Hits          466      466           
  Misses          7        7
Flag Coverage Δ
#unit 98.52% <100%> (ø) ⬆️
Impacted Files Coverage Δ
lib/samsam.js 100% <100%> (ø) ⬆️
lib/create-matcher.js 99.54% <100%> (ø)
lib/match.js 96.77% <100%> (ø) ⬆️
lib/deep-equal.js 97% <0%> (-1%) ⬇️
lib/is-arguments.js 92.3% <0%> (+7.69%) ⬆️

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 f0a4cdb...1329ceb. Read the comment docs.

@mroderick mroderick mentioned this pull request Aug 31, 2019
2 tasks
Copy link
Member

@mantoni mantoni left a comment

Choose a reason for hiding this comment

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

Nice!

@mroderick mroderick merged commit 04dfbbc into sinonjs:master Sep 2, 2019
@mroderick mroderick deleted the rename-matcher-to-create-matcher branch September 2, 2019 09:46
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.

2 participants