{"id":16419141,"url":"https://github.com/cameronhunter/jest-plugin-datapoints","last_synced_at":"2026-05-17T05:40:32.752Z","repository":{"id":145461787,"uuid":"597210211","full_name":"cameronhunter/jest-plugin-datapoints","owner":"cameronhunter","description":"Create Jest test cases from the cartesian product of data points","archived":false,"fork":false,"pushed_at":"2023-02-03T22:14:08.000Z","size":49,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-01-06T21:42:42.716Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cameronhunter.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-03T21:51:44.000Z","updated_at":"2023-02-03T21:54:09.000Z","dependencies_parsed_at":null,"dependency_job_id":"3432544a-460a-480c-b7c8-3470db2dc1c8","html_url":"https://github.com/cameronhunter/jest-plugin-datapoints","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronhunter%2Fjest-plugin-datapoints","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronhunter%2Fjest-plugin-datapoints/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronhunter%2Fjest-plugin-datapoints/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronhunter%2Fjest-plugin-datapoints/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cameronhunter","download_url":"https://codeload.github.com/cameronhunter/jest-plugin-datapoints/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240486264,"owners_count":19809147,"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","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":[],"created_at":"2024-10-11T07:16:03.478Z","updated_at":"2026-05-17T05:40:32.725Z","avatar_url":"https://github.com/cameronhunter.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jest-datapoints-plugin\n\nThis is a Jest plugin which adds a `datapoints` method to `test` and `it`. Its\nuse is to provide a combinatorial test suite from user-provided data points.\nThis, mixed with snapshots, provides _high_ levels of coverage of the function\nunder test at the cost of human verification of the results.\n\nExample:\n\n```ts\nconst suite = test.datapoints({\n  a: [true, false],\n  b: [true, false]\n});\n\nsuite(({ a, b }) =\u003e {\n  expect(a \u0026\u0026 b).toMatchSnapshot();\n});\n\n// Test suites can also have titles which use the `$\u003cfield\u003e` syntax to use\n// data point values in the name.\nsuite('a: $a, b: $b', ({ a, b }) =\u003e {\n  expect(a \u0026\u0026 b).toMatchSnapshot();\n});\n```\n\nThe above example will create four test cases (the cartesian product of the\ndatapoints) and the resulting snapshot will look something like:\n\n```js\nexports[`snapshot {\"a\":false,\"b\":false} 1`] = `false`;\n\nexports[`snapshot {\"a\":false,\"b\":true} 1`] = `false`;\n\nexports[`snapshot {\"a\":true,\"b\":false} 1`] = `false`;\n\nexports[`snapshot {\"a\":true,\"b\":true} 1`] = `true`;\n```\n\n## Installation\n\n```sh\n$ yarn add --dev jest-plugin-datapoints\n```\n\nAdd the plugin to your Jest configuration:\n\n```json\n{\n  \"setupFilesAfterEnv\": [\"jest-plugin-datapoints\"]\n}\n```\n\nIf you're using TypeScript, you can add `jest-plugin-datapoints/types.d.ts` to\nyour `types` field in `tsconfig.json`. The values injected in the test case\nwill be fully typed from the inputs provided to the `datapoints` function.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcameronhunter%2Fjest-plugin-datapoints","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcameronhunter%2Fjest-plugin-datapoints","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcameronhunter%2Fjest-plugin-datapoints/lists"}