{"id":16419142,"url":"https://github.com/cameronhunter/jest-each-table","last_synced_at":"2026-05-17T06:41:26.815Z","repository":{"id":63255529,"uuid":"173515036","full_name":"cameronhunter/jest-each-table","owner":"cameronhunter","description":"Create a test-case table for use with Jest's test.each tagged template literal","archived":false,"fork":false,"pushed_at":"2021-08-24T22:38:26.000Z","size":87,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-06T21:42:42.056Z","etag":null,"topics":["jest","jest-each"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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}},"created_at":"2019-03-03T00:45:46.000Z","updated_at":"2021-08-24T22:38:28.000Z","dependencies_parsed_at":"2022-11-15T22:30:37.640Z","dependency_job_id":null,"html_url":"https://github.com/cameronhunter/jest-each-table","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronhunter%2Fjest-each-table","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronhunter%2Fjest-each-table/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronhunter%2Fjest-each-table/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cameronhunter%2Fjest-each-table/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cameronhunter","download_url":"https://codeload.github.com/cameronhunter/jest-each-table/tar.gz/refs/heads/master","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":["jest","jest-each"],"created_at":"2024-10-11T07:16:03.610Z","updated_at":"2025-10-12T19:49:37.711Z","avatar_url":"https://github.com/cameronhunter.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jest-each-table\n\nTake advantage of jest's `test.each` tagged template literal functionality\nwithout needing to hardcode the test-cases as template literals.\n\n## Usage\n\n```js\nimport createTestTable from 'jest-each-table';\n\nconst testcases = createTestTable(\n  [...Array(10)].map((_, i) =\u003e ({\n    inputs: { left: i, right: i },\n    output: i + i\n  }))\n);\n\nconst testsuite = test.each(...testcases);\n\ntestsuite('$inputs.left + $inputs.right = $output', ({ inputs, output }) =\u003e {\n  expect(inputs.left + inputs.right).toBe(output);\n});\n```\n\n## Context\n\nJest's `test.each` functionality can be used in two ways:\n\n1. [`test.each` (function)](https://jestjs.io/docs/en/api#1-testeachtable-name-fn-timeout):\n   This allows an `Array` of `Arrays` with the arguments that are passed into\n   the test fn for each row.\n2. [`test.each` (tagged template literal)](https://jestjs.io/docs/en/api#2-testeach-table-name-fn-timeout):\n   This allows a table of test-cases to be defined as an ES2015 string template.\n\nUnfortunately `test.each` (the function) uses `printf` formatting for creating\nthe test title which has serious drawbacks compared to how the title is\nformatted using `test.each` (the tagged template literal) which supports\n`$variable`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcameronhunter%2Fjest-each-table","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcameronhunter%2Fjest-each-table","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcameronhunter%2Fjest-each-table/lists"}