{"id":22840444,"url":"https://github.com/paucls/jasmine-parameterized","last_synced_at":"2025-04-28T10:49:50.896Z","repository":{"id":33209667,"uuid":"155045712","full_name":"paucls/jasmine-parameterized","owner":"paucls","description":"Parameterized unit tests for Jasmine","archived":false,"fork":false,"pushed_at":"2022-05-30T11:02:49.000Z","size":78,"stargazers_count":9,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-23T02:39:32.810Z","etag":null,"topics":["jasmine","javascript","parameterized-tests","testing","typescript","unit-tests"],"latest_commit_sha":null,"homepage":"","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/paucls.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-10-28T07:25:09.000Z","updated_at":"2023-08-10T23:31:19.000Z","dependencies_parsed_at":"2022-08-17T22:15:09.545Z","dependency_job_id":null,"html_url":"https://github.com/paucls/jasmine-parameterized","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paucls%2Fjasmine-parameterized","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paucls%2Fjasmine-parameterized/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paucls%2Fjasmine-parameterized/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paucls%2Fjasmine-parameterized/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paucls","download_url":"https://codeload.github.com/paucls/jasmine-parameterized/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251299505,"owners_count":21567234,"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":["jasmine","javascript","parameterized-tests","testing","typescript","unit-tests"],"created_at":"2024-12-13T01:11:57.404Z","updated_at":"2025-04-28T10:49:50.875Z","avatar_url":"https://github.com/paucls.png","language":"TypeScript","readme":"Jasmine-Parameterized\n=====================\n\n[![Build Status](https://travis-ci.org/paucls/jasmine-parameterized.svg)](https://travis-ci.org/paucls/jasmine-parameterized)\n\nParameterized unit tests for Jasmine.\n\n## Installation\n```\nnpm install jasmine-parameterized\n```\n\n## Usage\nThis library provides a convenient `cases` function to easily parameterized the execution of `it` spec functions.\n\n## Examples\n\n### Single parameter\n``` ts\nimport { cases } from 'jasmine-parameterized';\n\ndescribe('Customer', () =\u003e {\n\n    cases([\n        4,\n        14\n    ])\n    .it('should be a child when aged 4 to 14 years', (age) =\u003e {\n        const customer = new Customer(age);\n        expect(customer.isChild()).toBe(true);\n    });\n...\n```\n![single param](img/single_param.png)\n\n### Multiple parameters\n``` ts\ndescribe('Roman Numeral Converter', () =\u003e {\n\n    cases([\n        [1, 'I'],\n        [2, 'II'],\n        [3, 'III'],\n        [4, 'IV'],\n        [5, 'V'],\n        [6, 'VI']\n    ])\n    .it('converts Arabic number to its equivalent Roman numeral', ([arabic, roman]) =\u003e {\n        expect(romanFor(arabic)).toBe(roman);\n    });\n\n});\n```\n![multiple params](img/multiple_params.png)\n\n### Multiple named parameters\nFor complex cases or when we want to be more explicit.\n\n``` ts\ndescribe('Fibonacci Sequence', () =\u003e {\n\n    describe('First two numbers', () =\u003e {\n        cases([\n            {index: 0, expected: 0},\n            {index: 1, expected: 1}\n        ])\n        .it('should be same as index', ({index, expected}) =\u003e {\n            expect(fibonacciNumber(index)).toEqual(expected);\n        });\n    });\n\n    describe('Third number on', () =\u003e {\n        cases([\n            {index: 2, expected: 1},\n            {index: 3, expected: 2},\n            {index: 5, expected: 5}\n        ])\n        .it('should be the sum of previous two', ({index, expected}) =\u003e {\n            expect(fibonacciNumber(index)).toEqual(expected);\n        });\n    });\n\n});\n```\n![multiple named params](img/multiple_named_params.png)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaucls%2Fjasmine-parameterized","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpaucls%2Fjasmine-parameterized","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpaucls%2Fjasmine-parameterized/lists"}