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

Refactoring to ease contribution #46

Merged
merged 93 commits into from
Nov 7, 2018
Merged

Conversation

mroderick
Copy link
Member

As stated earlier (#42 (comment)), this is the first PR refactoring referee to make it easier to contribute to.

There is still a ways to go, but this PR is already huge.

I've tried to make it easy to follow by breaking down changes into commits. It may still take a long time to complete the review.

Breaking changes to the public API

I've taken the opportunity to tidy up the public API, and have removed a number of properties that end users should not be using.

This will mean that there are a number of things that we don't need to provide end user documentation for, and won't need to support forever.

In my opinion, it is better to tidy up the API now, before referee gets too much traction.

Removals:
  • referee.assert[every assertion].test - this was an internal artefact from buster
  • referee.assert.json.jsonParseExceptionMessage - not to be used by end users
  • referee.assert.exception.*Message - not to be used by end users
  • referee.assert.className.noClassNameMessage - not to be used by end users
  • referee.assert.tagName.noTagNameMessage - not to be used by end users
  • referee.prepareMessage - not to be used by end users
  • referee.format - not to be used by end users
  • referee.assert.match.exceptionMessage - not to be used by end users
  • referee.isArrayLike - not to be used by end users
  • referee.match - not to be used by end users

How to verify

  1. Check out this branch
  2. npm install
  3. npm test

Checklist for author

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

@mroderick mroderick added the semver:major changes will cause a new major version label Nov 7, 2018
@coveralls
Copy link

coveralls commented Nov 7, 2018

Pull Request Test Coverage Report for Build 174

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • 4 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-0.8%) to 95.195%

Files with Coverage Reduction New Missed Lines %
assertions/match.js 2 81.82%
assertions/match-json.js 2 90.48%
Totals Coverage Status
Change from base Build 169: -0.8%
Covered Lines: 578
Relevant Lines: 598

💛 - Coveralls

@mroderick
Copy link
Member Author

Something went wrong in my rebase, so tests are failing. Please hold on review

@mroderick mroderick changed the title Refactoring to ease contribution [WIP] Refactoring to ease contribution Nov 7, 2018
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.

Epic PR! Thank you for digging into it.

I found one minor thingy so far. Will review again once you figured out the build issue.

package.json Outdated Show resolved Hide resolved
@mroderick
Copy link
Member Author

You can go ahead with the review, it seems the only failure was reduction in coverage. (I will add a few commits to fix this)

@mantoni
Copy link
Member

mantoni commented Nov 7, 2018

Looks good to me. Especially nice that you took the time to write documentation for the rather complicated test helper 👍

@mroderick mroderick changed the title [WIP] Refactoring to ease contribution Refactoring to ease contribution Nov 7, 2018
Morgan Roderick added 20 commits November 7, 2018 12:41
These would be exposed as `assert.isTrue.test`, and would return a
Promise.

Some research into the git history reveals that this was added for some
interal purpose when referee was a major component of busterjs, and used
to be called `.internal`

sinonjs@6d33cbb

This was never documented as part of the public API.
The test should verify the end message, not how many times format was called
This is not used by referee itself
@mroderick mroderick merged commit 055c429 into sinonjs:master Nov 7, 2018
@mroderick mroderick deleted the refactoring-2 branch November 7, 2018 12:44
@mroderick
Copy link
Member Author

Thank you for your review. Brace yourself for more pull requests with test coverage and refactoring

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver:major changes will cause a new major version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants