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

feat: add verifyWithIndividualChecks #72

Merged
merged 4 commits into from
Dec 2, 2019

Conversation

sebastianquek
Copy link
Contributor

@sebastianquek sebastianquek commented Nov 27, 2019

Returns an array of promises, each promise corresponds to a verification check.
The last promise resolves to the overall validity based on all the checks.

This allows us to work on the promises independently from the other verification checks.

@sebastianquek sebastianquek force-pushed the feat/verifyWithIndividualChecks branch 2 times, most recently from c5587e8 to a44da8d Compare November 29, 2019 06:14
@sebastianquek sebastianquek force-pushed the feat/verifyWithIndividualChecks branch from a44da8d to 8ebd647 Compare December 2, 2019 02:11
@@ -61,3 +63,56 @@ describe("verify", () => {
});
});
});

describe("verifyWithIndividualChecks", () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

what does this test bring compare to integration test ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The integration test ensures the checks work on an actual document with the correct network specified (also ensures the various checks work properly together).

The unit test, on the other hand, mocks what's returned by the various checks and checks whether the returned values are correct given these mocks. Also, we can mimic the way the various promises resolve at different times.

How should we better spilt the test concerns?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As discussed, I've removed the unit tests that don't value add much.

@sebastianquek sebastianquek merged commit e2f888d into master Dec 2, 2019
@sebastianquek sebastianquek deleted the feat/verifyWithIndividualChecks branch December 2, 2019 07:12
@john-dot-oa
Copy link
Contributor

🎉 This PR is included in version 2.1.0 🎉

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.

3 participants