-
Notifications
You must be signed in to change notification settings - Fork 20
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
Conversation
c5587e8
to
a44da8d
Compare
a44da8d
to
8ebd647
Compare
src/verify.test.ts
Outdated
@@ -61,3 +63,56 @@ describe("verify", () => { | |||
}); | |||
}); | |||
}); | |||
|
|||
describe("verifyWithIndividualChecks", () => { |
There was a problem hiding this comment.
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 ?
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
🎉 This PR is included in version 2.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.