{"id":15825322,"url":"https://github.com/phenomnomnominal/parameterised","last_synced_at":"2025-06-16T12:35:01.748Z","repository":{"id":57136082,"uuid":"141787009","full_name":"phenomnomnominal/parameterised","owner":"phenomnomnominal","description":"Create parameterised tests from Markdown(ish) tables","archived":false,"fork":false,"pushed_at":"2018-07-21T06:46:16.000Z","size":18,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T09:27:30.224Z","etag":null,"topics":["javascript","parameterised","testing"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/phenomnomnominal.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":"2018-07-21T06:23:00.000Z","updated_at":"2019-01-22T23:34:40.000Z","dependencies_parsed_at":"2022-09-03T15:01:48.059Z","dependency_job_id":null,"html_url":"https://github.com/phenomnomnominal/parameterised","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/phenomnomnominal/parameterised","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenomnomnominal%2Fparameterised","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenomnomnominal%2Fparameterised/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenomnomnominal%2Fparameterised/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenomnomnominal%2Fparameterised/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phenomnomnominal","download_url":"https://codeload.github.com/phenomnomnominal/parameterised/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phenomnomnominal%2Fparameterised/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260162892,"owners_count":22968153,"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":["javascript","parameterised","testing"],"created_at":"2024-10-05T09:07:44.951Z","updated_at":"2025-06-16T12:35:01.695Z","avatar_url":"https://github.com/phenomnomnominal.png","language":"TypeScript","readme":"# @phenomnomnominal/parameterised\n\n[![npm version](https://img.shields.io/npm/v/@phenomnomnominal/parameterised.svg)](https://img.shields.io/npm/v/@phenomnomnominal/parameterised.svg)\n[![Code Climate](https://codeclimate.com/github/phenomnomnominal/parameterised/badges/gpa.svg)](https://codeclimate.com/github/phenomnomnominal/parameterised)\n[![Test Coverage](https://codeclimate.com/github/phenomnomnominal/parameterised/coverage.svg)](https://codeclimate.com/github/phenomnomnominal/parameterised/coverage)\n\nA little tool to create parameterised tests from [Markdown(ish) tables](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#tables)!\n\n## Installation\n\n```zsh\nnpm install @phenomnomnominal/parameterised --save-dev\n```\n\n## Parameterised testing\n\nWhen writing unit tests, sometimes it is useful to do something like the following:\n\n```javascript\n[\n    { a: 1, b: 2, expected: 3 },\n    { a: -1, b: 1, expected: 0 },\n    { a: 2.5, b: 2.5, expected: 5 }\n].forEach(test =\u003e {\n    const { a, b, expected } = test;\n    assert(a + b === expected);\n});\n```\n\nThat works well, but wouldn't it be nice to be able to format that in a slightly more readable way? Enter **`parameterised`**!\n\n```javascript\nimport { parameterised } from '@phenomnomnominal/parameterised';\n\nparameterised`\n\n    |  a  |  b  | expected |\n    |  1  |  2  |    3     |\n    |  -1 |  1  |    0     |\n    | 2.5 | 2.5 |    5     |\n\n`.forEach(test =\u003e {\n    const { a, b, expected } = test;\n    assert(a + b === expected);\n});\n```\n\n## Examples:\n\n**`parameterised`** can handle a bunch of different values:\n\n```javascript\nparameterised`\n\n    |      param1       |   param2    |   param3  |\n    | 1                 | 2           | 3         |\n    | \"hello\"           | a string    | \"\"        |\n    | {\"foo\":\"bar\"}     | undefined   | NaN       |\n    | ${{ baz: 'qux' }} | Infinity    | [0,1,2]   |\n    | ${new Date()}     | ${'string'} | 2e2       |\n    | null              | 0.00000001  | ${9**9}   |\n\n`;\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphenomnomnominal%2Fparameterised","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphenomnomnominal%2Fparameterised","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphenomnomnominal%2Fparameterised/lists"}