{"_id":"@animalswap/test-helpers","_rev":"1-7276581772d07ce4b85a5c7a0889118e","name":"@animalswap/test-helpers","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@animalswap/test-helpers","version":"0.1.0","description":"JavaScript testing helpers for AnimalSwap contract integration.","main":"index.js","resolutions":{"**/ua-parser-js":"^0.7.30"},"scripts":{"docs":"oz-docs","docs:watch":"npm run docs watch","lint":"eslint .","lint:fix":"eslint . --fix","release":"scripts/release/release.sh","test":"mocha --exit --recursive","test-legacy":"./scripts/test.sh --network ganache","test-integration":"bash -x test-integration/run-all.sh","version":"scripts/release/update-changelog-release-date.js"},"repository":{"type":"git","url":"git+https://github.com/AnimalSwapFinance/animalswap-test-helpers.git"},"keywords":["ethereum","smart","contracts","test","solidity","zeppelin","openzeppelin","animal","animalswap"],"author":{"name":"AnimalSwap"},"license":"MIT","bugs":{"url":"https://github.com/AnimalSwapFinance/animalswap-test-helpers/issues"},"homepage":"https://github.com/AnimalSwapFinance/animalswap-test-helpers#readme","dependencies":{"@openzeppelin/contract-loader":"^0.6.2","@openzeppelin/test-environment":"^0.1.9","@truffle/contract":"^4.0.35","ansi-colors":"^3.2.3","chai-bn":"^0.2.1","ethjs-abi":"^0.2.1","lodash.flatten":"^4.4.0","semver":"^5.6.0","web3":"^1.2.5","web3-utils":"^1.2.5"},"devDependencies":{"chai":"^4.3.4","eslint":"^5.9.0","eslint-config-standard":"^12.0.0","eslint-plugin-import":"^2.14.0","eslint-plugin-mocha-no-only":"^1.1.0","eslint-plugin-node":"^8.0.0","eslint-plugin-promise":"^4.0.1","eslint-plugin-standard":"^4.0.0","ganache-cli":"^6.5.0","mocha":"^8.1.2","openzeppelin-docs-utils":"git+https://OpenZeppelin@github.com/OpenZeppelin/docs-utils.git","truffle":"^5.1.46"},"gitHead":"4e28eb37486dbc2c248ce3774943409653099168","_id":"@animalswap/test-helpers@0.1.0","_nodeVersion":"16.13.0","_npmVersion":"8.1.3","dist":{"integrity":"sha512-cGGrrP38ZNx9DEzyEMKAB8hT7WA2MCkvyQ1Lffg78T+1ZWd9xjaVSSZhddGpevdzUIgWpV4GSRTi+vA6BMpcQQ==","shasum":"e5411380329431d77820efccbe62c6321fdb62de","tarball":"https://registry.npmjs.org/@animalswap/test-helpers/-/test-helpers-0.1.0.tgz","fileCount":20,"unpackedSize":370013,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiJYtUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpjGg//ZU8Au1x3wAXzPeL9dH/sWtc/BTT3z90gwcTrQUmM2O6rfNQv\r\nMwPXWp1Ahsy6xeXpf6aCOmxwPAcXKJnA1s8QLRE3XdM8tRs8XFhmCGS8vwww\r\noZaF2g+o6FWVtJngj5Y2UmFBim/Gubcvyy1sk7OsgnRxhANiJfVJmY92nSpb\r\nBUh9AczTUCz7y+y4iYc/n1w0HNT19wUIrvtKxZWZj2/p/iwJktASpRgdCx+W\r\nmNujXoGVmXUPjtTV3sVBOguDUEAR840xcwWirkb/XxQtUhbJkGnKfs3QfgC0\r\nVy7zUTUChFc8+flx9X6Ck7kMneQtb6zd5iKYd6L+df1z2yFi4HbNNoW6Cyco\r\nNHBnfm5QzCQq+JcyuwLgW0WVPJEvPeynuFKGX9+kOhyxaiRh1Wm6sx3BA18D\r\nEb+a+xREioBrkzsMTQJGw6wTGBsYj6pdnjSQzK3WMlidGaTlDDbDfZW7KLHz\r\nghnCOH8k6PZz6/mC51o7S44+sin+Y+K1FV0kyTylYUJHiEnRhlOsm93cuh1R\r\n6O0GZ5GkJCkccBTIvtehq+WR5qeyImq5dTErHwn8rpgtr/rOsPEJZqK7uBt/\r\nR0cl792deZ38lB/O5/UZbKGlynWBAvDHmkHPJY0CfKxd71jvbkmHaLjKru7d\r\nuk1FMqdcMpMJDqmRZfGl68N5fcYGR5X+cTs=\r\n=wlsx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFvK08fwT7jdS0Jtd40MtAYbcO9gdH8pIvoZOT3DIhyCAiEApjMos5KLY4T64eZd7TUXhGaC60fUkJZU4oQP03IdqkA="}]},"_npmUser":{"name":"apolloriver","email":"apollo@paw.digital"},"directories":{},"maintainers":[{"name":"apolloriver","email":"apollo@paw.digital"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/test-helpers_0.1.0_1646627668139_0.008368242975101525"},"_hasShrinkwrap":false}},"time":{"created":"2022-03-07T04:34:28.077Z","0.1.0":"2022-03-07T04:34:28.315Z","modified":"2022-04-04T14:11:16.576Z"},"maintainers":[{"name":"apolloriver","email":"apollo@paw.digital"}],"description":"JavaScript testing helpers for AnimalSwap contract integration.","homepage":"https://github.com/AnimalSwapFinance/animalswap-test-helpers#readme","keywords":["ethereum","smart","contracts","test","solidity","zeppelin","openzeppelin","animal","animalswap"],"repository":{"type":"git","url":"git+https://github.com/AnimalSwapFinance/animalswap-test-helpers.git"},"author":{"name":"AnimalSwap"},"bugs":{"url":"https://github.com/AnimalSwapFinance/animalswap-test-helpers/issues"},"license":"MIT","readme":"# AnimalSwap Test Helpers\n\nA suite of Solidity smart contract test helpers. Use to easily test contracts against popular AnimalSwap features.\n### _**NOTICE**_: \nThis project uses [@openzeppelin/test-environment](https://github.com/OpenZeppelin/openzeppelin-test-environment) under the hood to deploy contracts to the development. Using this helper module assumes you are using `@openzeppelin/test-environment` for testing as well.\n\n## Overview\n\n### Installation\n\n```bash\nyarn add -D @animalswapfinance/test-helpers\n```\nOR \n```bash\nnpm install --save-dev @animalswapfinance/test-helpers\n```\n\n### Configruation\nAs this module is hosted as a GitHub package, create a `.npmrc` file in the root of your project with these details: \n\n```\n@animalswapfinance:registry=https://npm.pkg.github.com\n//npm.pkg.github.com/:_authToken=${NPM_TOKEN}\n```\n\nIn your environment, set `NPM_TOKEN` to your [github access token](https://docs.github.com/en/packages/learn-github-packages/introduction-to-github-packages#authenticating-to-github-packages). \n```bash\nexport NPM_TOKEN=<github-access-token>\n```\n\n#### Hardhat (formerly Buidler)\nInstall `web3` and the `hardhat-web3` plugin.\n\n```\nnpm install --save-dev @nomiclabs/hardhat-web3 web3\n```\n\nRemember to include the plugin in your configuration as explained in the [installation instructions](https://hardhat.org/plugins/nomiclabs-hardhat-web3.html#installation).\n\n### Usage\n\nImport `@animalswapfinance/test-helpers` in your test files to access helper deploy functions.\n\n\n**Mock Farm**\n```javascript\nconst {\n  dex,  // Deploy/manage a test dex\n  farm, // Deploy/manage a test farm\n} = require('@animalswapfinance/test-helpers');\nconst { accounts, contract } = require('@openzeppelin/test-environment');\nconst { assert } = require('chai');\n\ndescribe('MasterAnimal', function () {\n    const [owner, feeTo, alice, bob, carol] = accounts;\n\n    beforeEach(async () => {\n        const {\n            treatToken,\n            treatSplitBar,\n            masterAnimal,\n        } = await farm.deployMockFarm(accounts); // accounts passed will be used in the deployment\n        this.masterAnimal = masterAnimal;\n    });\n\n    it('should have proper pool length', async () => {\n        assert.equal((await this.masterAnimal.poolLength()).toString(), '1');\n    });\n});\n```\n\n**Mock Dex**\n```javascript\nconst {\n  dex,  // Deploy/manage a test dex\n  farm, // Deploy/manage a test farm\n} = require('@animalswapfinance/test-helpers');\nconst { accounts, contract } = require('@openzeppelin/test-environment');\nconst { assert } = require('chai');\n\ndescribe('AnimalFactory', function () {\n    this.timeout(10000);\n    const [owner, feeTo, alice, bob, carol] = accounts;\n\n    beforeEach(async () => {\n        const {\n            dexFactory,\n            mockWBNB,\n            mockTokens,\n            dexPairs\n        } = await dex.deployMockDex(accounts, 5); // accounts passed will be used in the deployment\n        this.dexFactory = dexFactory;\n    });\n\n    it('should have proper pair length', async () => {\n        assert.equal((await this.dexFactory.allPairsLength()).toString(), '5');\n    });\n});\n```\n\n## License\n\n[MIT](LICENSE)\n","readmeFilename":"README.md"}