{"id":18584463,"url":"https://github.com/ipfs-examples/helia-jest","last_synced_at":"2026-01-21T01:32:31.994Z","repository":{"id":186979494,"uuid":"675997016","full_name":"ipfs-examples/helia-jest","owner":"ipfs-examples","description":"Test Helia with Jest","archived":false,"fork":false,"pushed_at":"2025-05-01T07:36:41.000Z","size":8,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-01T08:30:28.172Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/ipfs-examples.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-08T07:45:24.000Z","updated_at":"2025-05-01T07:36:45.000Z","dependencies_parsed_at":"2024-01-19T16:42:39.410Z","dependency_job_id":"ba0875d6-68d1-4ca0-8a76-34ecb3f41d57","html_url":"https://github.com/ipfs-examples/helia-jest","commit_stats":null,"previous_names":["ipfs-examples/helia-jest"],"tags_count":0,"template":false,"template_full_name":"ipfs-examples/example-fork-go-template","purl":"pkg:github/ipfs-examples/helia-jest","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs-examples%2Fhelia-jest","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs-examples%2Fhelia-jest/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs-examples%2Fhelia-jest/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs-examples%2Fhelia-jest/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ipfs-examples","download_url":"https://codeload.github.com/ipfs-examples/helia-jest/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ipfs-examples%2Fhelia-jest/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28621636,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T23:49:58.628Z","status":"ssl_error","status_checked_at":"2026-01-20T23:47:29.996Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":[],"created_at":"2024-11-07T00:27:37.109Z","updated_at":"2026-01-21T01:32:31.977Z","avatar_url":"https://github.com/ipfs-examples.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/ipfs/helia\" title=\"Helia\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/ipfs/helia/main/assets/helia.png\" alt=\"Helia logo\" width=\"300\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003e\u003cb\u003eTest Helia with Jest\u003c/b\u003e\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/jlord/forkngo/gh-pages/badges/cobalt.png\" width=\"200\"\u003e\n  \u003cbr\u003e\n  \u003ca href=\"https://ipfs.github.io/helia/modules/helia.html\"\u003eExplore the docs\u003c/a\u003e\n  ·\n  \u003ca href=\"https://github.com/ipfs-examples/helia-examples/issues\"\u003eReport Bug\u003c/a\u003e\n  ·\n  \u003ca href=\"https://github.com/ipfs-examples/helia-examples/issues\"\u003eRequest Feature/Example\u003c/a\u003e\n\u003c/p\u003e\n\n## About\n\n[Jest](https://jestjs.io/) is a JavaScript testing framework that transpiles code on the fly to enable a fast-feedback testing cycle for the developer.\n\nIt is typically used to test browser code, whereby it injects an artificial DOM implementation into the global scope to enable running the actual tests on [Node.js](https://nodejs.org) to take advantage of faster startup times at the cost of not always having 100% feature/behavior parity with the actual target platform.\n\nIn some circumstances this is helpful but it can also result in hard to debug errors, particularly around resolving modules and loading them.\n\nSome developers also use Jest to test pure Node.js code which the benefit of familiarity but also has the same issues around transpilation.\n\n```\n FAIL  test/index.spec.js\n  ● Test suite failed to run\n\n    Jest encountered an unexpected token\n\n    Jest failed to parse a file. This happens e.g. when your code or its dependencies use non-standard JavaScript syntax, or when Jest is not configured to support such syntax.\n\n    Out of the box Jest supports Babel, which will be used to transform your files into valid JS based on your Babel configuration.\n\n    By default \"node_modules\" folder is ignored by transformers.\n```\n\nJest transpiles code when it is loaded via the module system. Historically Node.js made it easy to hook into this system via `require` but with [ESM](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Modules) at the time of writing a flag to enable [vm-modules](https://nodejs.org/api/vm.html#class-vmmodule) needs to be passed to Node.js.\n\n## Putting it all together\n\nIt's possible to run the Jest test in this module with `npm test`:\n\n```console\n% NODE_OPTIONS=--experimental-vm-modules jest\n\n PASS  test/index.spec.ts (6.055 s)\n  Helia\n    libp2p\n      ✓ should have a peer id (519 ms)\n\nTest Suites: 1 passed, 1 total\nTests:       1 passed, 1 total\nSnapshots:   0 total\nTime:        6.134 s\nRan all test suites.\n```\n\nThat's it! You just successfully ran a suite that can test your Helia application using Jest and ESM.\n\n## About The Project\n\n- Read the [docs](https://ipfs.github.io/helia/modules/helia.html)\n- Look into other [examples](https://github.com/ipfs-examples/helia-examples) to learn how to spawn a Helia node in Node.js and in the Browser\n- Visit https://dweb-primer.ipfs.io to learn about IPFS and the concepts that underpin it\n- Head over to https://proto.school to take interactive tutorials that cover core IPFS APIs\n- Check out https://docs.ipfs.io for tips, how-tos and more\n- See https://blog.ipfs.io for news and more\n- Need help? Please ask 'How do I?' questions on https://discuss.ipfs.io\n\n## Getting Started\n\n### Prerequisites\n\nMake sure you have installed all of the following prerequisites on your development machine:\n\n- Git - [Download \u0026 Install Git](https://git-scm.com/downloads). OSX and Linux machines typically have this already installed.\n- Node.js - [Download \u0026 Install Node.js](https://nodejs.org/en/download/) and the npm package manager.\n\n### Installation and Running example\n\n```console\n\u003e npm install\n\u003e npm test\n```\n\n## Documentation\n\n- [IPFS Primer](https://dweb-primer.ipfs.io/)\n- [IPFS Docs](https://docs.ipfs.io/)\n- [Tutorials](https://proto.school)\n- [More examples](https://github.com/ipfs-examples/helia-examples)\n- [API - Helia](https://ipfs.github.io/helia/modules/helia.html)\n- [API - @helia/unixfs](https://ipfs.github.io/helia-unixfs/modules/helia.html)\n\n## Contributing\n\nContributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are **greatly appreciated**.\n\n1. Fork the IPFS Project\n2. Create your Feature Branch (`git checkout -b feature/amazing-feature`)\n3. Commit your Changes (`git commit -a -m 'feat: add some amazing feature'`)\n4. Push to the Branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## Want to hack on IPFS?\n\n[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)\n\nThe IPFS implementation in JavaScript needs your help! There are a few things you can do right now to help out:\n\nRead the [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md) and [JavaScript Contributing Guidelines](https://github.com/ipfs/community/blob/master/CONTRIBUTING_JS.md).\n\n- **Check out existing issues** The [issue list](https://github.com/ipfs/helia/issues) has many that are marked as ['help wanted'](https://github.com/ipfs/helia/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3A%22help+wanted%22) or ['difficulty:easy'](https://github.com/ipfs/helia/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc+label%3Adifficulty%3Aeasy) which make great starting points for development, many of which can be tackled with no prior IPFS knowledge\n- **Look at the [Helia Roadmap](https://github.com/ipfs/helia/blob/main/ROADMAP.md)** This are the high priority items being worked on right now\n- **Perform code reviews** More eyes will help\n  a. speed the project along\n  b. ensure quality, and\n  c. reduce possible future bugs\n- **Add tests**. There can never be enough tests\n\n[cid]: https://docs.ipfs.tech/concepts/content-addressing  \"Content Identifier\"\n[Uint8Array]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array\n[libp2p]: https://libp2p.io\n[IndexedDB]: https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API\n[S3]: https://aws.amazon.com/s3/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipfs-examples%2Fhelia-jest","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fipfs-examples%2Fhelia-jest","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fipfs-examples%2Fhelia-jest/lists"}