{"id":13604792,"url":"https://github.com/OpenZeppelin/openzeppelin-test-environment","last_synced_at":"2025-04-12T02:31:32.145Z","repository":{"id":50947569,"uuid":"218123474","full_name":"OpenZeppelin/openzeppelin-test-environment","owner":"OpenZeppelin","description":"[Not actively maintained] One-line setup for blazing-fast smart contracts tests","archived":true,"fork":false,"pushed_at":"2021-08-20T22:13:02.000Z","size":3241,"stargazers_count":90,"open_issues_count":30,"forks_count":37,"subscribers_count":23,"default_branch":"master","last_synced_at":"2025-04-01T00:02:52.273Z","etag":null,"topics":["ethereum","smart-contracts","solidity","test","testing","web3"],"latest_commit_sha":null,"homepage":"https://docs.openzeppelin.com/test-environment","language":"Solidity","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OpenZeppelin.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-28T18:59:55.000Z","updated_at":"2024-01-21T22:27:21.000Z","dependencies_parsed_at":"2022-08-28T14:21:54.385Z","dependency_job_id":null,"html_url":"https://github.com/OpenZeppelin/openzeppelin-test-environment","commit_stats":null,"previous_names":["openzeppelin/test-env"],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenZeppelin%2Fopenzeppelin-test-environment","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenZeppelin%2Fopenzeppelin-test-environment/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenZeppelin%2Fopenzeppelin-test-environment/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OpenZeppelin%2Fopenzeppelin-test-environment/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OpenZeppelin","download_url":"https://codeload.github.com/OpenZeppelin/openzeppelin-test-environment/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248467355,"owners_count":21108630,"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":["ethereum","smart-contracts","solidity","test","testing","web3"],"created_at":"2024-08-01T19:00:51.331Z","updated_at":"2025-04-12T02:31:31.793Z","avatar_url":"https://github.com/OpenZeppelin.png","language":"Solidity","readme":"\u003e :warning: **This project is not being actively maintained.** It is advisable to use an alternative ([Hardhat](https://hardhat.org/), [Truffle](https://www.trufflesuite.com/truffle)).\n\n# OpenZeppelin Test Environment\n\n[![Docs](https://img.shields.io/badge/docs-%F0%9F%93%84-blue)](https://docs.openzeppelin.com/test-environment)\n[![NPM Package](https://img.shields.io/npm/v/@openzeppelin/test-environment.svg)](https://www.npmjs.org/package/@openzeppelin/test-environment)\n[![Build Status](https://circleci.com/gh/OpenZeppelin/openzeppelin-test-environment.svg?style=shield)](https://circleci.com/gh/OpenZeppelin/openzeppelin-test-environment)\n\n**Blazing fast smart contract testing.** One-line setup for an awesome testing experience.\n\n- Near-instant start up: have your code running in under 2s after typing `npm test`.\n- Test runner agnostic – from the familiarity of Mocha, to [_parallel tests_](https://docs.openzeppelin.com/test-environment/choosing-a-test-runner#parallel-tests) using Jest or Ava!\n- Non-opinionated: use either [`@truffle/contract`](https://www.npmjs.com/package/@truffle/contract) or [`web3-eth-contract`](https://web3js.readthedocs.io/en/v1.2.0/web3-eth-contract.html) as you see fit.\n- First class support for the [OpenZeppelin Test Helpers](https://docs.openzeppelin.com/test-helpers).\n- Highly configurable: from gas limit and initial balance, to complex custom web3 providers.\n- No global variables, no hacks.\n\n_`test-environment` is the result of our learnings while developing the [OpenZeppelin Contracts](https://docs.openzeppelin.com/contracts), combining best practices and the tools we've come to rely on over the years. We think you'll love it!_\n\n## Overview\n\n### Installation\n\n```bash\nnpm install --save-dev @openzeppelin/test-environment\n```\n\n### Usage\n\nBy including `require('@openzeppelin/test-environment')` in your test files, a local [ganache-powered blockchain](https://github.com/trufflesuite/ganache-core) with unlocked accounts will be spun up, and all tools configured to work with it.\n\nHere's a quick sample of how using `test-environment` in a [Mocha](https://mochajs.org/) + [Chai](https://www.chaijs.com/) setup looks like.\n\n```javascript\nconst { accounts, contract } = require('@openzeppelin/test-environment');\nconst [ owner ] = accounts;\n\nconst { expect } = require('chai');\n\nconst MyContract = contract.fromArtifact('MyContract'); // Loads a compiled contract\n\ndescribe('MyContract', function () {\n  it('deployer is owner', async function () {\n    const myContract = await MyContract.new({ from: owner });\n    expect(await myContract.owner()).to.equal(owner);\n  });\n});\n```\n\nIf you're used to `truffle test`, this probably looks very familiar. Follow our guide on [migrating from Truffle](https://docs.openzeppelin.com/test-environment/migrating-from-truffle) to have your project running with `test-environment` in a breeze!\n\n_Note: if you'd rather not rely on truffle contracts and use web3 contract types directly, worry not: you can [configure `test-environment`](https://docs.openzeppelin.com/test-environment/getting-started#configuration) to use the `web3-eth-contract` abstraction._\n\n## Learn More\n\n * Check out [Getting Started](https://docs.openzeppelin.com/test-environment/getting-started) to use Test Environment in a new project.\n * If you are currently using `truffle test`, head instead to [Migrating from Truffle](https://docs.openzeppelin.com/test-environment/migrating-from-truffle).\n * The [Choosing a Test Runner](https://docs.openzeppelin.com/test-environment/choosing-a-test-runner) guide will teach you how to use each of the different runners.\n * For detailed usage information, take a look at the [API Reference](https://docs.openzeppelin.com/test-environment/api).\n\n## License\n\nReleased under the [MIT License](LICENSE).\n","funding_links":[],"categories":["[Ethereum](https://ethereum.org/en/)"],"sub_categories":["Whitepapers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenZeppelin%2Fopenzeppelin-test-environment","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOpenZeppelin%2Fopenzeppelin-test-environment","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOpenZeppelin%2Fopenzeppelin-test-environment/lists"}