-
Notifications
You must be signed in to change notification settings - Fork 60
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
Added cancellableTaskValidation feature, tests, and documentation #217
Added cancellableTaskValidation feature, tests, and documentation #217
Conversation
❤️ This is so awesome.
Yeah I've gone back and forth on this. Do whatever you feel is easier at this point. It's not much work to clean up later. |
I'm fine leaving it for now, and we can always decide later when looking at the job validation since that would technically need similar code |
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.
Awesome start on this. Left some comments:
|
||
|
||
let ``CancellableTaskValidationCE bind Tests`` = | ||
testList "CancellableTaskValidationCE bind Tests" [ |
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.
This is a good start but I think we're also going to need tests for:
- Task
- Task<'T>
- Any awaitable (like Task.Yield()) (this should cover ValueTask/ValueTask<'T> as well)
- Async
- All these variants with Result/Validation as well.
Yeah this is gonna hurt.
- [Added cancellableTaskValidation feature, tests, and documentation](#217) Credits @1eyewonder
Proposed Changes
I added support for CancellableTaskValidation with relevant documentation and unit tests. I also fixed/updated some miscellaneous documentation
Types of changes
What types of changes does your code introduce to FsToolkit.ErrorHandling?
Put an
x
in the boxes that apply and remove ones that don't applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.Further comments
As a 'quick-fix' I brought over some of the code which was in the FsToolkit.ErrorHandling.Tests project: Expect.fs, SampleDomain.fs, and TestData.fs for easier unit test implementation (copied and modified from AsyncValidation). I didn't know you wanted to create a shared test library for reduced code or if you wanted to keep things siloed from each other. I am open to either implementation