{"id":16592859,"url":"https://github.com/honzabrecka/rapid-check","last_synced_at":"2025-10-05T14:57:03.416Z","repository":{"id":46934284,"uuid":"96343656","full_name":"honzabrecka/rapid-check","owner":"honzabrecka","description":"Yet another implementation of property based testing framework","archived":false,"fork":false,"pushed_at":"2023-01-04T01:05:12.000Z","size":662,"stargazers_count":2,"open_issues_count":14,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-07T20:05:56.135Z","etag":null,"topics":["javascript","property-based-testing","quickcheck","tdd","test-framework"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/honzabrecka.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-05T17:18:20.000Z","updated_at":"2021-10-15T15:24:41.000Z","dependencies_parsed_at":"2023-02-01T17:01:44.027Z","dependency_job_id":null,"html_url":"https://github.com/honzabrecka/rapid-check","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/honzabrecka/rapid-check","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honzabrecka%2Frapid-check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honzabrecka%2Frapid-check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honzabrecka%2Frapid-check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honzabrecka%2Frapid-check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/honzabrecka","download_url":"https://codeload.github.com/honzabrecka/rapid-check/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/honzabrecka%2Frapid-check/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278470182,"owners_count":25992203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-05T02:00:06.059Z","response_time":54,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","property-based-testing","quickcheck","tdd","test-framework"],"created_at":"2024-10-11T23:22:41.007Z","updated_at":"2025-10-05T14:57:03.369Z","avatar_url":"https://github.com/honzabrecka.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rapid-check [![CircleCI](https://circleci.com/gh/honzabrecka/rapid-check/tree/master.svg?style=svg\u0026circle-token=14045240bf5689c38b0a3dcbf478a2f012ab6574)](https://circleci.com/gh/honzabrecka/rapid-check/tree/master)\n\nYet another implementation of property based testing framework with support for async properties.\n\n## Prerequisities\n\nIt's based on async generators, therefore it requires nodejs \u003e=10.\n\n## Installation\n\n```console\nnpm install rapid-check\n```\n\n## Usage\n\nWorks with any testing framework, here's an example using [jest \u003e=23](https://facebook.github.io/jest/):\n\n```js\nconst { gen } = require('rapid-check')\nconst toMatchProperty = require('rapid-check/src/jest.matcher')\n\nexpect.extend({ toMatchProperty })\n\ntest('Set.has function', async () =\u003e {\n  const prop = (v) =\u003e new Set([1, 2, 3]).has(v)\n  await expect(gen.choose(1, 3)).toMatchProperty(prop)\n})\n```\n\n## Generators\n\n### constantly(any)\n\n```js\nsample(constantly(4))\n// [4, 4, 4, 4, ...]\n```\n\n### choose(min, max)\n\n```js\nsample(choose(1, 3))\n// [2, 1, 3, 1, ...]\n```\n\n### bool\n\n```js\nsample(bool)\n// [true, true, false, true, ...]\n```\n\n### int\n\n```js\nsample(int)\n// [0, 1, -2, 3, ...]\n```\n\n### uint\n\n```js\nsample(uint)\n// [0, 1, 0, 3, ...]\n```\n\n### tuple(...gens)\n\n```js\nsample(tuple(uint, uint))\n// [[0, 0], [1, 0], [1, 2], [0, 1], ...]\n```\n\n### array(gen, min, max)\n\n```js\nsample(array(uint, 1, 3))\n// [[0], [1], [2, 0], [1, 1], [0], [0, 3, 3], ...]\n```\n\n### oneOf(...gens)\n\n```js\nsample(oneOf(bool, uint))\n// [true, 1, 2, false, ...]\n```\n\n### fmap(f, gen)\n\nWhere f: `a -\u003e b`\n\n```js\nconst negate = (n) =\u003e -n\nsample(fmap(negate, uint))\n// [0, -1, -1, -3, ...]\n```\n\n### mbind(f, gen)\n\nWhere f: `a -\u003e Gen b`\n\n```js\nconst f = (n) =\u003e ap(tuple, repeat(bool, n))\nsample(mbind(f, uint))\n// [[], [true], [false, false], [false], ... [true, false, false, true, false], [false]]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonzabrecka%2Frapid-check","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhonzabrecka%2Frapid-check","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhonzabrecka%2Frapid-check/lists"}