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

Add documentation page on testing with cats-effect #1216

Merged
merged 2 commits into from
Sep 28, 2020

Conversation

Daenyth
Copy link
Contributor

@Daenyth Daenyth commented Sep 20, 2020

Addressing #1214


## 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

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

Copy link
Member

@djspiewak djspiewak left a 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

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)
Copy link
Member

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.

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 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)

Copy link
Member

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. :-)

site/src/main/mdoc/testing/index.md Outdated Show resolved Hide resolved
@djspiewak djspiewak removed the CE 3 label Sep 25, 2020
@Daenyth Daenyth requested a review from djspiewak September 27, 2020 03:20
@djspiewak djspiewak merged commit cee13c3 into typelevel:series/2.x Sep 28, 2020
@Daenyth Daenyth deleted the gb-testing-doc branch September 29, 2020 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants