{"id":16453466,"url":"https://github.com/blimmer/jest-circleci-orb","last_synced_at":"2025-03-23T10:32:10.464Z","repository":{"id":46279547,"uuid":"326510416","full_name":"blimmer/jest-circleci-orb","owner":"blimmer","description":"This orb makes it easier to run jest tests in your CircleCI environment. A primary benefit is automatically restoring the jest cache for faster subsequent test runs.","archived":false,"fork":false,"pushed_at":"2022-09-29T20:22:08.000Z","size":133,"stargazers_count":9,"open_issues_count":4,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-10-12T10:15:39.994Z","etag":null,"topics":["circleci","circleci-orb","circleci-orbs","jest"],"latest_commit_sha":null,"homepage":"https://circleci.com/developer/orbs/orb/blimmer/jest","language":"TypeScript","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/blimmer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2021-01-03T22:11:34.000Z","updated_at":"2022-10-03T08:41:22.000Z","dependencies_parsed_at":"2023-01-18T18:34:22.417Z","dependency_job_id":null,"html_url":"https://github.com/blimmer/jest-circleci-orb","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blimmer%2Fjest-circleci-orb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blimmer%2Fjest-circleci-orb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blimmer%2Fjest-circleci-orb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/blimmer%2Fjest-circleci-orb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/blimmer","download_url":"https://codeload.github.com/blimmer/jest-circleci-orb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221849295,"owners_count":16891416,"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":["circleci","circleci-orb","circleci-orbs","jest"],"created_at":"2024-10-11T10:15:43.343Z","updated_at":"2024-10-28T15:32:27.120Z","avatar_url":"https://github.com/blimmer.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jest-circleci-orb\n\nThis orb makes running [jest](https://jestjs.io/) tests fast and easy. The primary\nfunctionality this orb provides is saving / restoring the jest cache, which makes\nsubsequent test runs faster.\n\n## Benefits of Storing the Jest Cache\n\nJest stores useful information in the cache, which improves the performance of your\ntest suite.\n\n- **Reduced startup time** Jest stores information about the file structure and mocks you create in your\n  tests. By restoring the previous `jest-haste-map` data, it reduces the amount of work jest has to do at startup.\n\n- **Even distribution of test suites across workers** If you're running your test suites in parallel (enabled by default),\n  jest will cache information about how long each of your test suites takes to run. It then uses this information\n  to evenly distribute your test suites across the jest workers, so they all complete their work around the same time.\n  This prevents one slow test suite from holding up the entire jest run.\n\n- **Fast fail with `bail` config.** Jest also stores whether each individual test succeeded or failed on the previous run, and\n  runs failed tests as soon as possible on the next run. This is very handy when used in conjunction with the\n  [`bail`](https://jestjs.io/docs/en/configuration.html#bail-number--boolean) configuration, so you get super-fast feedback\n  on previously failed tests.\n\n- **Faster Typescript transpiling.** If you're using TypeScript with jest, your files are likely transpiled to Javascript\n  before each run. By restoring the cache, jest will only transpile changed files.\n\nIf you want to learn more about the jest cache, check out [Jest Architecture video](https://youtu.be/3YDiloj8_d0) on YouTube.\n\n\u003cdiv style='display: flex; align-items: center; justify-content: center;'\u003e\n  \u003ca href='https://youtu.be/3YDiloj8_d0'\u003e\n    \u003cimg src=https://img.youtube.com/vi/3YDiloj8_d0/0.jpg\u003e\n  \u003c/a\u003e\n\u003c/div\u003e\n\n## Usage\n\nSee the [orb registry listing](https://circleci.com/developer/orbs/orb/blimmer/jest) for usage details.\n\n## Configuration\n\nTo save / restore the jest cache between runs, you must set jest's\n[`cacheDirectory` configuration property](https://jestjs.io/docs/en/configuration#cachedirectory-string) to a predictable\nlocation.\n\nIn your jest configuration file (e.g. `jest.config.js`, `jest.config.ts` or in your `package.json`), set\n`cacheDirectory` to `.jest-cache`. For example,\n\n```js\n// jest.config.js\nmodule.exports = {\n  // other configuration properties\n  cacheDirectory: '.jest-cache'\n}\n```\n\nYou should also `gitignore` this directory. Add `.jest-cache` to your `.gitignore` file.\n\nIf you don't have a jest configuration file, refer to the [documentation](https://jestjs.io/docs/en/configuration)\nto learn how to create one.\n\n## Examples\n\n```yml\nversion: 2.1\n\norbs:\n  # Replace x.y.z. with a real version number. All versions are listed here:\n  # https://circleci.com/developer/orbs/orb/blimmer/jest\n  jest: blimmer/jest@x.y.z\n\n  workflows:\n    test:\n      jobs:\n        - jest/test\n```\n\nRefer to the [orb registry listing](https://circleci.com/developer/orbs/orb/blimmer/jest) for more examples.\n\n## Breaking Changes\n\nBreaking changes, such as those between 0.x and 1.x, are described in [CHANGELOG.md](/CHANGELOG.md).\n\n## Contributing\n\nI welcome [issues](https://github.com/blimmer/jest-circleci-orb/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc) and\n[pull requests](https://github.com/blimmer/jest-circleci-orb/pulls?q=is%3Apr+is%3Aopen+sort%3Aupdated-desc) against this\nrepository!\n\n## About the Author\n\nYou can learn more about the author [here](https://benlimmer.com/freelance/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblimmer%2Fjest-circleci-orb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fblimmer%2Fjest-circleci-orb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fblimmer%2Fjest-circleci-orb/lists"}