{"id":13770244,"url":"https://github.com/egm0121/jest-test-gen","last_synced_at":"2026-01-14T16:00:51.315Z","repository":{"id":39660228,"uuid":"414010904","full_name":"egm0121/jest-test-gen","owner":"egm0121","description":"This tool will take a js/ts file as input and generate a jest unit test file next to it with all imports mocked and tests stubs for every class method and function exported.","archived":false,"fork":true,"pushed_at":"2023-02-05T04:26:47.000Z","size":1334,"stargazers_count":184,"open_issues_count":6,"forks_count":26,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-10-20T07:37:16.930Z","etag":null,"topics":["es6-classes","es6-modules","jest","scaffolding","typescript","unit-test","unit-test-generator"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"FDIM/jasmine-unit-test-generator","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/egm0121.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-10-05T23:41:21.000Z","updated_at":"2025-10-11T15:12:00.000Z","dependencies_parsed_at":"2023-02-09T16:46:15.524Z","dependency_job_id":null,"html_url":"https://github.com/egm0121/jest-test-gen","commit_stats":null,"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/egm0121/jest-test-gen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egm0121%2Fjest-test-gen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egm0121%2Fjest-test-gen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egm0121%2Fjest-test-gen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egm0121%2Fjest-test-gen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/egm0121","download_url":"https://codeload.github.com/egm0121/jest-test-gen/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/egm0121%2Fjest-test-gen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28425596,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T15:24:48.085Z","status":"ssl_error","status_checked_at":"2026-01-14T15:23:41.940Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["es6-classes","es6-modules","jest","scaffolding","typescript","unit-test","unit-test-generator"],"created_at":"2024-08-03T17:00:35.526Z","updated_at":"2026-01-14T16:00:51.227Z","avatar_url":"https://github.com/egm0121.png","language":"TypeScript","funding_links":[],"categories":["Packages"],"sub_categories":["Generators"],"readme":"# JestTestGen\n![badgenpm](https://img.shields.io/npm/dm/jest-test-gen.svg) ![badgenpm](https://img.shields.io/npm/v/jest-test-gen.svg)\n\n## 🚀 Try jest-test-gen as a VS Code Extension\n\n**The VS Code extension is the fastest way to generate a unit test file from a source file directly from the IDE**\n\n[Install jest-test-gen Extension](https://marketplace.visualstudio.com/items?itemName=com-egm0121.vs-jest-test-gen)\n\n## About\n\nAutomates creation of initial unit test files taking dependencies into account.\n\nParsing and test generation is avaialable for the following exports:\n\n* Typescript typed React class components 🆕\n* Typescript typed Functional components 🆕\n* React Functional components 🆕\n* React Class based components 🆕\n* ES6 Classes default export or named exports\n* Exported named functions and arrow functions\n* Exported POJOs with methods\n* Async functions and methods\n\nThis tool will take a js/ts file as input and generate a jest unit test file next to it with all imports mocked and tests stubs for every class method and function exported.\n\nThis project is inspired and started as a fork of [jasmine-unit-test-generator](https://github.com/FDIM/jasmine-unit-test-generator)\n\n## Preview\n\nBasic ES6 Class example: \n\n![Basic](./assets/demo.jpg)\n\nReact Component example:\n\n![ReactComponent](./assets/component.jpg)\n\n## Usage\n\n### Installation\n\nrun `npm i -g jest-test-gen`\n\n### Basic Usage\n\nrun `jest-test-gen \u003cpath-to-file\u003e`\n\n\n## Development\n\nIt's probably best to:\n\n* add an input file in `spec/fixtures` folder test.js\n* add a snapshot test for the input spec in `integration.spec.ts`\n* verify that the snapshot is actually the wanted test output before commiting the updated snapshot.\n\nAlternavely, you can:\n\n* run `npm link`\n* run `npm run build:dev`\n* run `jest-test-gen \u003coption\u003e` in your project of choice\n\n## Release\nrun `npm run build`\nrun `npm publish`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegm0121%2Fjest-test-gen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fegm0121%2Fjest-test-gen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fegm0121%2Fjest-test-gen/lists"}