{"id":13410254,"url":"https://github.com/enitrat/cairo1-mocha","last_synced_at":"2026-03-20T00:00:36.797Z","repository":{"id":159507508,"uuid":"634680449","full_name":"enitrat/cairo1-mocha","owner":"enitrat","description":null,"archived":false,"fork":false,"pushed_at":"2023-05-02T15:23:22.000Z","size":36,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-19T04:37:26.786Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Cairo","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/enitrat.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-04-30T22:32:55.000Z","updated_at":"2023-05-02T06:22:17.000Z","dependencies_parsed_at":"2024-10-26T05:50:41.497Z","dependency_job_id":"1ca02cfd-d2e1-4781-af79-edddb49eeb71","html_url":"https://github.com/enitrat/cairo1-mocha","commit_stats":null,"previous_names":[],"tags_count":0,"template":true,"template_full_name":null,"purl":"pkg:github/enitrat/cairo1-mocha","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enitrat%2Fcairo1-mocha","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enitrat%2Fcairo1-mocha/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enitrat%2Fcairo1-mocha/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enitrat%2Fcairo1-mocha/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/enitrat","download_url":"https://codeload.github.com/enitrat/cairo1-mocha/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/enitrat%2Fcairo1-mocha/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29679049,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T09:33:50.764Z","status":"ssl_error","status_checked_at":"2026-02-21T09:33:19.949Z","response_time":107,"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-07-30T20:01:05.824Z","updated_at":"2026-02-21T11:02:23.148Z","avatar_url":"https://github.com/enitrat.png","language":"Cairo","funding_links":[],"categories":["Templates"],"sub_categories":[],"readme":"# Cairo1 project with Mocha + StarknetJS\n\nAs the tooling around Cairo 1 is still in its infancy, there is currently (01/05/2023)\nno satisfying way of extensively testing your contracts.\n\n- Protostar is relying on an older version of the compiler (alpha.6) which lacks support for the last features, making it complitely unusable ATM.\n- starknet-hardhat-plugin has no integration and requires you to write custom scripts to adapt the output of Scarb to the input of the hardhat plugin; and some features like contract calls are bugged.\n- The default `cairo-test` runner works great for unit testing, but is not suited for integration testing and to test cross-contract interacitons due to a lack of testing features (like prank calls)\n\nThis project aims to provide a simple way of testing your contracts using Mocha and StarknetJS. While not ideal (extremely slow), it is just temporary and hopefully can be migrated into a more convenient solution soon. Hopefully, the work done by Dojo on [Katana](https://github.com/dojoengine/katana) will help improve performance.\n\n## Requirements\n\n- [Starknet Devnet](https://github.com/0xSpaceShard/starknet-devnet)\n- [Scarb](https://docs.swmansion.com/scarb/docs)\n- [NodeJS](https://nodejs.org/en/)\n- [Cairo](https://cairo-book.github.io/ch01-01-installation.html) (favor building from main branch)\n\n## How to use\n\n1. Clone this repository\n2. Install dependencies: `npm install`\n3. Write your contracts as a Scarb package under the `src/` directory\n4. Write your tests under the `test/` directory\n5. Write your unit tests (ran with `cairo-test`) in `test/cairo-test`\n6. Generate the vanilla cairo-project architecture by running `scarb run gen-project`\n7. Run your unit tests using `scarb run test-cairo`\n8. Compile your contracts using `scarb_build`.\n9. Start a starknet-devnet instance with your local compiler version and the seed `42`:\n\n```bash\nstarknet-devnet --cairo-compiler-manifest ~/path/to/cairo/Cargo.toml --seed 42\n```\n\n10. Run your tests: `scarb run test-devnet`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenitrat%2Fcairo1-mocha","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fenitrat%2Fcairo1-mocha","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fenitrat%2Fcairo1-mocha/lists"}