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

Vitest: Add support for property testing #3698

Open
jessekelly881 opened this issue Sep 27, 2024 · 1 comment
Open

Vitest: Add support for property testing #3698

jessekelly881 opened this issue Sep 27, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@jessekelly881
Copy link
Contributor

What is the problem this feature would solve?

Adding property testing with schema and effect would be a nice addition. Similar to:
https://www.npmjs.com/package/@fast-check/vitest

What is the feature you are proposing to solve the problem?

import { Schema } from "@effect/schema";
import { it } from "@effect/vitest";
import { Effect } from "effect";

it.prop(Schema.Number, Schema.Number).sync("", (a: number, b: number) => {
    return a + b === b + a
})

it.prop(Schema.Number, Schema.Number).effect("", (a: number, b: number) => Effect.gen(function* () {
    return a + b === b + a; 
}))

What alternatives have you considered?

No response

@jessekelly881 jessekelly881 added the enhancement New feature or request label Sep 27, 2024
@jessekelly881
Copy link
Contributor Author

I'll create a PR.

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

No branches or pull requests

1 participant