{"id":21462496,"url":"https://github.com/tribou/jest-serializer-path","last_synced_at":"2025-06-23T19:06:44.452Z","repository":{"id":46938781,"uuid":"90413512","full_name":"tribou/jest-serializer-path","owner":"tribou","description":"Remove absolute paths from your Jest snapshots","archived":false,"fork":false,"pushed_at":"2022-12-07T09:17:11.000Z","size":51538,"stargazers_count":20,"open_issues_count":22,"forks_count":8,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-01T17:24:27.603Z","etag":null,"topics":["absolute-paths","jest","jest-serializer","jest-serializer-path","jest-snapshots","snapshot","snapshot-testing","testing"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tribou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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":"2017-05-05T20:24:05.000Z","updated_at":"2025-04-22T08:00:05.000Z","dependencies_parsed_at":"2023-01-23T16:30:13.381Z","dependency_job_id":null,"html_url":"https://github.com/tribou/jest-serializer-path","commit_stats":null,"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"purl":"pkg:github/tribou/jest-serializer-path","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tribou%2Fjest-serializer-path","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tribou%2Fjest-serializer-path/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tribou%2Fjest-serializer-path/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tribou%2Fjest-serializer-path/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tribou","download_url":"https://codeload.github.com/tribou/jest-serializer-path/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tribou%2Fjest-serializer-path/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261539319,"owners_count":23174136,"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":["absolute-paths","jest","jest-serializer","jest-serializer-path","jest-snapshots","snapshot","snapshot-testing","testing"],"created_at":"2024-11-23T07:14:32.263Z","updated_at":"2025-06-23T19:06:44.411Z","avatar_url":"https://github.com/tribou.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# jest-serializer-path\n\n[![npm version](https://badge.fury.io/js/jest-serializer-path.svg)](https://badge.fury.io/js/jest-serializer-path)\n[![Linux Build Status](https://img.shields.io/circleci/project/github/tribou/jest-serializer-path/master.svg?label=linux%20build)](https://circleci.com/gh/tribou/jest-serializer-path/tree/master)\n[![Windows Build Status](https://img.shields.io/appveyor/ci/tribou/jest-serializer-path/master.svg?label=windows%20build)](https://ci.appveyor.com/project/tribou/jest-serializer-path/branch/master)\n[![Coverage Status](https://coveralls.io/repos/github/tribou/jest-serializer-path/badge.svg?branch=master)](https://coveralls.io/github/tribou/jest-serializer-path?branch=master)\n[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](http://www.repostatus.org/badges/latest/active.svg)](http://www.repostatus.org/#active)\n[![bitHound Code](https://www.bithound.io/github/tribou/jest-serializer-path/badges/code.svg)](https://www.bithound.io/github/tribou/jest-serializer-path)\n\nRemove absolute paths and normalize paths across all platforms in your Jest snapshots.\n\n#### Quick Start\n\n```bash\nnpm install --save-dev jest-serializer-path\n```\n\nAdd this to your `package.json` Jest config:\n\n```\n\"jest\": {\n  \"snapshotSerializers\": [\n    \"jest-serializer-path\"\n  ]\n}\n```\n\nOr include only in individual tests:\n\n```js\nconst serializer = require(\"jest-serializer-path\");\n\nexpect.addSnapshotSerializer(serializer);\n```\n\nAll absolute paths will now be converted and saved in snapshots like so:\n\n`/path/to/my-proj/lib` =\u003e `\u003cPROJECT_ROOT\u003e/lib`\n\n`/path/to/os-temp/nested/temp` =\u003e `\u003cTEMP_DIR\u003e/nested/temp`\n\n`/path/to/user-home/nested/home` =\u003e `\u003cHOME_DIR\u003e/nested/home`\n\n#### Caveats\n\n*   All single backslashes (`\\`) will be replaced by a forward slash (`/`).\n*   Any string that looks like a Windows drive letter (`C:\\`) will be replaced by a forward slash (`/`).\n\n#### Build\n\nThis project bundles the yarn executable and the npm/yarn dependencies offline\nin the `.npm-packages-offline-cache` directory for faster dependency installs\nand better dev/prod parity across including preventing failure if yarn/npm is\noffline.\n\n```sh\n# Install\nnpm run yarn\n\n# Run tests\nnpm run test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftribou%2Fjest-serializer-path","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftribou%2Fjest-serializer-path","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftribou%2Fjest-serializer-path/lists"}