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

[Munit] PropF with custom TestParameters yields a False Positive #186

Closed
manuelcueto opened this issue Apr 4, 2022 · 1 comment
Closed

Comments

@manuelcueto
Copy link
Contributor

in munit.ScalaCheckEffectSuite
we provide a ValueTransform for a PropF, where we call "check" it with scalacheckTestParameters (which can be overriden for a whole suite). However, let's consider overriding said parameters for a specific PropF:

test("foo") {
  forAllF { (a: Int) =>
    // some testing returning an F[Unit]
  }.check(Parameters.default.withMinSuccessfulTests(2)) // returns F[Test.Result]
}

This test will run and pass since munit will fail a test only if an Exception is thrown. Since the only ValueTransform defined in munit.ScalaCheckEffectSuite is defined for PropF[F], it won't be used, and instead the CatsEffectSuite value transform will be triggered, converting the F[Test.Result] into a Future[Test.Result] which can be understood by Munit. Still, since no exceptions are raised, the test will then be a pass.

There should be support for providing custom Parameters to a PropF.

@manuelcueto manuelcueto changed the title Munit Props with custom TestParameters throw False Positive [Munit] PropF with custom TestParameters yields a False Positive Apr 4, 2022
@mpilquist
Copy link
Member

Fixed by #187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants