{"_id":"@apeswap.finance/test-helpers","_rev":"1-6ddacabd25e43b0542be3f6d0b350435","name":"@apeswap.finance/test-helpers","dist-tags":{"latest":"0.2.0"},"versions":{"0.2.0":{"name":"@apeswap.finance/test-helpers","version":"0.2.0","description":"JavaScript testing helpers for ApeSwap 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/ApeSwapFinance/apeswap-test-helpers.git"},"keywords":["ethereum","smart","contracts","test","solidity","zeppelin","openzeppelin","ape","apeswap"],"author":{"name":"ApeSwap"},"license":"MIT","bugs":{"url":"https://github.com/ApeSwapFinance/apeswap-test-helpers/issues"},"homepage":"https://github.com/ApeSwapFinance/apeswap-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":"8529909b7c57ecc275c017b5d243055959244e63","_id":"@apeswap.finance/test-helpers@0.2.0","_nodeVersion":"15.14.0","_npmVersion":"8.1.0","dist":{"integrity":"sha512-TnTwlJ5HmgjXELfhYdsMevkGtqiBVclansClBF8Y05EDFPDLt3v6A6bOC+dhp98lNBw+SXF6pVEc1SJSEX922w==","shasum":"fecaca3ce27b39e3ad509d6e43b7fecb9925553d","tarball":"https://registry.npmjs.org/@apeswap.finance/test-helpers/-/test-helpers-0.2.0.tgz","fileCount":20,"unpackedSize":369664,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+cIkCRA9TVsSAnZWagAAbaAP/08yE0dvGToz9o2HW7P4\n0Z1Wx8myMEYueq9t6lZT4Yk680MuAkqRUGjr4Txtc+6m+vDdkEsW2DxZxQHl\n3myxc9FsmAVzqKQ5TxA05ks+J/xq+vTw5R0/srIufOsnAQv97xYkJjBnoBTN\nMm+XXvCQ0ezNnPPU6RMJu8cF2G3qZjWY091Q21sx89s60OMDG+s4q2U2f2pq\nqyLTT75wmxgfheIewSaNBKna7EEZPD4DAAUPmql2+LaKWvcfdipsetsCDoD8\nEBT6IPdrE/ljKU70xrk6Re3PWbylaWLALUBx06eMppjnCRNKp0dENmaZExqw\nlFS5FSehG/W8AxlD6YdBT1RtEfVWFXW2wI/IOgf6gjkBQakyCLM64RHAPFmL\n/cuw+KSvUyOV+txpKJPFvA5ynI/Wa1LeP6ItK3ewFJnW7GVPhQKquWJ1TBAe\nt9WDa1ZQGn3BZn5BWF41wL7dDeOpcorUdLre0ZM6QPtbk2jJN15B1+R7/80u\nbQXsGfwCMuPSWR1WJt17uWA2r5gEvuWM7iIA1SmOa5yGrNYDq9QhY1bDLCm2\nz930xfTuwlJZPglgs99t17+sFKUytM7YNXR92PUHcJfdIjKH01AU5uJ+6rHy\n1ER34xF6bjHC79N7b7l2gTvWzGFyb60h+h3Pdz2ArGOO/bqZb123HOgZ/nQu\nNkgk\r\n=4R7k\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDP9RBlVg9WF5WgvE10HYchZ156/pM1D4LrYmHcTT0B4wIgUEr0XZn1wJRZCn2bGxQc9iboRhpjD4DZuS6noyrwN3A="}]},"_npmUser":{"name":"defifofum","email":"DeFiFoFum0@gmail.com"},"directories":{},"maintainers":[{"name":"defifofum","email":"DeFiFoFum0@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/test-helpers_0.2.0_1643758116174_0.39441877426262506"},"_hasShrinkwrap":false}},"time":{"created":"2022-02-01T23:28:36.126Z","0.2.0":"2022-02-01T23:28:36.329Z","modified":"2022-04-04T14:33:03.446Z"},"maintainers":[{"name":"defifofum","email":"DeFiFoFum0@gmail.com"}],"description":"JavaScript testing helpers for ApeSwap contract integration.","homepage":"https://github.com/ApeSwapFinance/apeswap-test-helpers#readme","keywords":["ethereum","smart","contracts","test","solidity","zeppelin","openzeppelin","ape","apeswap"],"repository":{"type":"git","url":"git+https://github.com/ApeSwapFinance/apeswap-test-helpers.git"},"author":{"name":"ApeSwap"},"bugs":{"url":"https://github.com/ApeSwapFinance/apeswap-test-helpers/issues"},"license":"MIT","readme":"# ApeSwap Test Helpers\n\nA suite of Solidity smart contract test helpers. Use to easily test contracts against popular ApeSwap 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 @apeswapfinance/test-helpers\n```\nOR \n```bash\nnpm install --save-dev @apeswapfinance/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@apeswapfinance: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 `@apeswapfinance/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('@apeswapfinance/test-helpers');\nconst { accounts, contract } = require('@openzeppelin/test-environment');\nconst { assert } = require('chai');\n\ndescribe('MasterApe', function () {\n    const [owner, feeTo, alice, bob, carol] = accounts;\n\n    beforeEach(async () => {\n        const {\n            bananaToken,\n            bananaSplitBar,\n            masterApe,\n        } = await farm.deployMockFarm(accounts); // accounts passed will be used in the deployment\n        this.masterApe = masterApe;\n    });\n\n    it('should have proper pool length', async () => {\n        assert.equal((await this.masterApe.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('@apeswapfinance/test-helpers');\nconst { accounts, contract } = require('@openzeppelin/test-environment');\nconst { assert } = require('chai');\n\ndescribe('ApeFactory', 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"}