{"id":13660542,"url":"https://github.com/codeandcats/jest-helpers","last_synced_at":"2026-04-18T07:35:33.267Z","repository":{"id":33097110,"uuid":"151651141","full_name":"codeandcats/jest-helpers","owner":"codeandcats","description":"TypeScript helper functions for Jest to help make your tests resilient to refactoring.","archived":false,"fork":false,"pushed_at":"2023-01-04T21:37:07.000Z","size":1178,"stargazers_count":2,"open_issues_count":24,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-02-01T07:50:35.304Z","etag":null,"topics":[],"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/codeandcats.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-05T00:10:35.000Z","updated_at":"2020-04-16T10:25:34.000Z","dependencies_parsed_at":"2023-01-14T23:20:38.804Z","dependency_job_id":null,"html_url":"https://github.com/codeandcats/jest-helpers","commit_stats":null,"previous_names":[],"tags_count":27,"template":false,"template_full_name":null,"purl":"pkg:github/codeandcats/jest-helpers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeandcats%2Fjest-helpers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeandcats%2Fjest-helpers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeandcats%2Fjest-helpers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeandcats%2Fjest-helpers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codeandcats","download_url":"https://codeload.github.com/codeandcats/jest-helpers/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codeandcats%2Fjest-helpers/sbom","scorecard":{"id":295898,"data":{"date":"2025-08-11","repo":{"name":"github.com/codeandcats/jest-helpers","commit":"1c584d5dd3d4915ed2372c879212d2a29978e4c0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/17 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 26 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"41 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-5fw9-fq32-wv5p","Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-44c6-4v22-4mhx","Warn: Project is vulnerable to: GHSA-4x5v-gmq8-25ch","Warn: Project is vulnerable to: GHSA-7xcx-6wjh-7xp2","Warn: Project is vulnerable to: GHSA-jgrx-mgxx-jf9v","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693","Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T19:29:36.862Z","repository_id":33097110,"created_at":"2025-08-17T19:29:36.862Z","updated_at":"2025-08-17T19:29:36.862Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31961347,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T00:39:45.007Z","status":"online","status_checked_at":"2026-04-18T02:00:07.018Z","response_time":103,"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":[],"created_at":"2024-08-02T05:01:22.792Z","updated_at":"2026-04-18T07:35:33.242Z","avatar_url":"https://github.com/codeandcats.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# jest-helpers\n\n\u003cbr /\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"logo.png\" height=\"100\"\u003e\n  \u003cp align=\"center\"\u003eTests should be living documentation for your code, but often test descriptions get out of sync with your code. This library helps keep them in sync using TypeScript.\u003c/p\u003e\n\u003c/p\u003e\n\u003cbr /\u003e\n\n[![npm version](https://badge.fury.io/js/jest-helpers.svg)](https://badge.fury.io/js/jest-helpers)\n[![Build Status](https://travis-ci.org/codeandcats/jest-helpers.svg?branch=master)](https://travis-ci.org/codeandcats/jest-helpers)\n[![Coverage Status](https://coveralls.io/repos/github/codeandcats/jest-helpers/badge.svg?branch=master)](https://coveralls.io/github/codeandcats/jest-helpers?branch=master)\n\n\n## Benefits\n- When you rename a class, the name of your test for it will automatically update\n- When you rename any of the following, your test will get a TypeScript error until you update your test:\n  - A method on a class\n  - A field on a class\n  - An exported function inside a module\n- Has useful functions for creating mocks:\n  - `partialOf\u003cT\u003e(partial: Partial\u003cT\u003e): T`\n  - `deepPartialOf\u003cT\u003e(partial: DeepPartial\u003cT\u003e): T`\n\n\n## Install\n```sh\nnpm install jest-helpers --save-dev\n```\n\n## Usage\n`./greeter.ts`\n```typescript\nexport class Greeter {\n  getGreeting(name: string) {\n    return `Hello ${name}`;\n  }\n}\n\nexport function showGreeting(greeter: Greeter, name: string) {\n  const greeting = greeter.getGreeting(name)\n  console.log(greeting)\n}\n```\n\n`./greeter.test.ts`\n```typescript\nimport { describeClass, describeFunction, describeMethod, partialOf } from 'jest-helpers';\nimport greeterModule = require('greeter');\nimport { Greeter, showGreeting } from './greeter';\n\ndescribeClass(Greeter, () =\u003e {\n  describeMethod(Greeter, 'getGreeting', () =\u003e {\n    it('should return a personalised greeting', () =\u003e {\n      const greeter = new Greeter();\n      expect(greeter.getGreeting('Joe')).toEqual('Hello Joe');\n    });\n  });\n});\n\ndescribeFunction(greeterModule, 'showGreeting', () =\u003e {\n  it('should log greeting to the console', () =\u003e {\n    const greeterMock = partialOf\u003cGreeter\u003e({\n      getGreeting: jest.fn().mockReturnValue('yo!')\n    });\n\n    jest.spyOn(console, 'log');\n\n    showGreeting(greeterMock, 'Joe');\n\n    expect(greeterMock.getGreeting).toHaveBeenCalledWith('Joe');\n    expect(console.log).toHaveBeenCalledWith('yo!');\n  });\n});\n```\n\nRunning `jest --verbose` will output something like\n```\n  example/greeter.ts\n    Greeter\n      getGreeting\n        ✓ should return a personalised greeting (4ms)\n    showGreeting\n      ✓ should log greeting to the console (2ms)\n```\n\nIf you rename your `Greeter` class, it will automatically update the test description.\n\nIf you rename your `Greeter.getGreeting` method, you will get a TypeScript error in your test until you update your test to match the new name.\n\nIf you rename your `showGreeting` function, you will get a TypeScript error in your test until you update your test to match the new name.\n\n\n## Contributing\nGot an issue or a feature request? [Log it](https://github.com/codeandcats/jest-helpers/issues).\n\n[Pull-requests](https://github.com/codeandcats/jest-helpers/pulls) are also welcome. 😸\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeandcats%2Fjest-helpers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodeandcats%2Fjest-helpers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodeandcats%2Fjest-helpers/lists"}