-
Notifications
You must be signed in to change notification settings - Fork 529
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
Add documentation page on testing with cats-effect #1216
Conversation
|
||
## Compatible libraries | ||
|
||
Relatively few libraries support cats-effect directly at this time. However, most (if not all) popular testing frameworks have libraries offering some level of integration |
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 new Cats Effect documentation site is going to include some of this as well (https://github.com/typelevel/cats-effect/blob/docs/website/pages/en/ecosystem.js#L48), but it's probably worth including here as well
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 amazing. Just a couple quick notes
site/src/main/mdoc/testing/index.md
Outdated
To support writing effectful properties with the shape `A => F[Assertion]`, you can use one of these tools: | ||
|
||
- [scalacheck-effect](https://github.com/typelevel/scalacheck-effect) | ||
- [cats-effect-testing](https://github.com/djspiewak/cats-effect-testing) |
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.
I think cats-effect-testing actually doesn't support A => F[Assertion]
properties, does it? I may be derping.
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 docs suggest that it does; https://github.com/djspiewak/cats-effect-testing#scalatest-scalacheck
"My IO Code" - {
"works with effect-full property-based testing" in {
forAll { (l1: List[Int], l2: List[Int]) =>
IO.delay(l1.size + l2.size shouldBe (l1 ::: l2).size)
}
}
I think from skimming the code it doesn't support true async properties (so, probably won't work on scala.js)
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.
Ooooooooh I get why this is working. Okay this is a fair bullet point then. But yeah, it's not going to work on scala.js. :-)
As suggested by PR feedback
Addressing #1214