{"_id":"@blocklytics/truffle-test-generator","_rev":"5-7e5629681403f206b5b097f62ad29dde","name":"@blocklytics/truffle-test-generator","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"@blocklytics/truffle-test-generator","author":{"name":"Chris Piatt","url":"chris@blocklytics.org"},"version":"1.0.0","description":"A test file generator for the Truffle framework","bin":{"ttg":"testGen.js"},"keywords":["solidity","truffle","test","generator","ethereum"],"homepage":"https://blocklytics.org","repository":{"type":"git","url":"git+https://github.com/pyython/truffle-test-generator.git"},"license":"MIT","dependencies":{"fs":"0.0.1-security"},"bugs":{"url":"https://github.com/pyython/truffle-test-generator/issues"},"main":"testGen.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"gitHead":"d0f308d14507326a36a087c4a5f16e71a6f38a0f","_id":"@blocklytics/truffle-test-generator@1.0.0","_nodeVersion":"13.6.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-f+CHRNjP3Kdh9hIzXwS+FrRoJony9g9uYE/4pfh8nn2roYdu0BSV75r/wR56yLIWUnTZwrfNbN/G75Dj1Cra7A==","shasum":"e4c5dc577abf450e3b16ee58511f77febb91a0dd","tarball":"https://registry.npmjs.org/@blocklytics/truffle-test-generator/-/truffle-test-generator-1.0.0.tgz","fileCount":4,"unpackedSize":6949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeUq1FCRA9TVsSAnZWagAAp2wP/18a/DYxDaUUM3hcsITG\nk+xjmYlhA1lO3ZHRZYHeXHxEhLP+xzpCtHRBIZw2W5nkl2jnsizvMQCz1ujq\nna6cKk1iibujv+PsXDuiUyEaxrNDm4kv492g5BVvqbtXaubL2EEXV6Uc+BRT\nlAGZ4yBix1omNcRiSazuH0RhFWHftrvKZj9eX6aZMSoGCUViZORzMv5Ed5qE\nlagvTNtycgVnC5odB9ZScTiFLsCzaK/JAft2TLGcn7kRsT0KkMoglwoRl3h2\ndUjSgeUrJAo8JaFlPrcdrDZbad4Wmc1NuuEl7LALLk4QBgSys0CX4ghJeMAA\nrbYUScQrirH5LoGAK/4S1pvQusQZzRVx5XaIl3tqjiZ4xXSF92c/ajPWHXlw\n5v6K0meKq6O3S5BopNtoRmbdIDGEDs5h+KJRANQKve1n2l58JDaqIvqClpxF\npTjnl9QWYsZCCp1bX2oDrInh63yphPsn5e08TDZdQ1FdIt6VgKG8TTPTLJvI\nLsFYKtuhDHDfq8yhnGge6v3aaxdWHhHA9T+Nn/FXiwOI2jDlnrSy98EdNm1c\nljSloehXommPFUSBLn0bR+DcucIZ5wIZO/BgN/YHA7uvWwbfNowk347aYp66\nBqKTxFT284BEzWXnfxC2KJFISZGZUxmv6T+B4W9uSWfDPcBQ9yTMQIHuUHcl\nh0Nw\r\n=RV62\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGS+3dbKwVY/m1MmyvEY7bDoTsUkDPDKsvEOJ4i0/EoqAiAhiNuUGQf8djL0n4WuiH194uGWGBKcx/8o5OMgrmfQPg=="}]},"maintainers":[{"name":"chpiatt","email":"chris@blocklytics.org"}],"_npmUser":{"name":"chpiatt","email":"chris@blocklytics.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/truffle-test-generator_1.0.0_1582476613190_0.60892117694367"},"_hasShrinkwrap":false},"1.0.1":{"name":"@blocklytics/truffle-test-generator","author":{"name":"Chris Piatt","url":"chris@blocklytics.org"},"version":"1.0.1","description":"A test file generator for the Truffle framework","bin":{"ttg":"testGen.js"},"keywords":["solidity","truffle","test","generator","ethereum"],"homepage":"https://blocklytics.org","repository":{"type":"git","url":"git+https://github.com/pyython/truffle-test-generator.git"},"license":"MIT","dependencies":{"fs":"0.0.1-security"},"bugs":{"url":"https://github.com/pyython/truffle-test-generator/issues"},"main":"testGen.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"gitHead":"d0f308d14507326a36a087c4a5f16e71a6f38a0f","_id":"@blocklytics/truffle-test-generator@1.0.1","_nodeVersion":"13.6.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-UBzRZUmz6/F8WMRnFERpPQ9ieKEUdAhkLldcjcnIxEhebJvcJhT19PLYfD7XyqgMC6ht/9xdHOcBjqGcpMFJTg==","shasum":"b09eb0d644a88a81b81c127fda5f8a31247f4797","tarball":"https://registry.npmjs.org/@blocklytics/truffle-test-generator/-/truffle-test-generator-1.0.1.tgz","fileCount":4,"unpackedSize":6955,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeUq2eCRA9TVsSAnZWagAAcW0P/RUKOsy5mC9F7Z0bjmDe\nEmu3YEuizSd2ZgQmcByJ/YqMj8ZN0O/1OC3iIalDOx23A3bffTD476F47xs6\nSz6rlG4RdWn02bEf+r8ZzCbqfyLPbgXtpsELuPvLR3KXytcZtoCJAJsoCgBd\nrZZOl/yQzCp+t+vvqRUhyvQTtcMoxdqTlNS2Fj8JRcDxJ5FFepATFzWSwlOz\nOHCj3w6EY9ZnSiFJ+SH3p5GBOdCldAAjocud3lh1RtuP6mPvdWINjCEABQW8\nHR5UOU0zd/IiPyi53PtmbSv77pj4W/aFomKs6mHf+jQ3gK1466fFOewBdHFX\n2nxUxe+G3HsUf3DaScaub6ToexXHQPqoI9j9c6BWkLzI9ajEmIMVct/K62h7\nItrUWZm/+KzQTjIJNjT4c7mOY7dijRXd6sRmz7dq2YsTNDY/4b1X4eJ46m7R\nlZfx7kpXOC98Aw5C1GCIo7S0uAwwS5omJzh5gG7lJ/WY77ZHm9aOXlDuWT1O\nobGTR836zO6KxPdazI0TJ1cAwMqRPVHWnYZS+Mtx9HFtXZ++Wi4vfojfLRwM\ntSEUKhQ28peNTBvifW8A54W1Odmrz//2HgPITx3IA8bIpYpbXBTvxG7RNq3h\nQDAcZBIv+8n+rrEprCgQxl18dB0UKs44GP9xB1qLUYxUBLS0wqrIdkBu4PLF\nAPqA\r\n=9xqm\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAdo+ExgmMkXLvAkLYoelfCGjx5USlkx8WEUrMY+k/IkAiAzKGh3uCTkXNtqKFy8l0MYeXYp6TYKNQKyNqtpLve1Fg=="}]},"maintainers":[{"name":"chpiatt","email":"chris@blocklytics.org"}],"_npmUser":{"name":"chpiatt","email":"chris@blocklytics.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/truffle-test-generator_1.0.1_1582476701803_0.47153490459857816"},"_hasShrinkwrap":false},"1.0.2":{"name":"@blocklytics/truffle-test-generator","author":{"name":"Chris Piatt","url":"chris@blocklytics.org"},"version":"1.0.2","description":"A test file generator for the Truffle framework","bin":{"ttg":"testGen.js"},"keywords":["solidity","truffle","test","generator","ethereum"],"homepage":"https://blocklytics.org","repository":{"type":"git","url":"git+https://github.com/pyython/truffle-test-generator.git"},"license":"MIT","dependencies":{"fs":"0.0.1-security"},"bugs":{"url":"https://github.com/pyython/truffle-test-generator/issues"},"main":"testGen.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"gitHead":"d0f308d14507326a36a087c4a5f16e71a6f38a0f","_id":"@blocklytics/truffle-test-generator@1.0.2","_nodeVersion":"13.6.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-wBDNEPY2nY303ZCE1BSj9lxgyGTw9muXLAH9eiIsl/4BEQJI4x5p3kJeJkmfersAFGElj2vlgMaULQj80WI3JA==","shasum":"6042030f5ff7b2dc48481b72b156ba12d9d5ebc4","tarball":"https://registry.npmjs.org/@blocklytics/truffle-test-generator/-/truffle-test-generator-1.0.2.tgz","fileCount":4,"unpackedSize":7065,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeUrR3CRA9TVsSAnZWagAAzSkQAJ9GMSF1cdLkF2sxQWpr\nrq3wD5Ta95pWsbMpxTu+yTOhrvQ+i/CAOxcsDYJxFCakTFsZLquehSkFuUDa\nHJewZu/eO+d84lkVlOgUgqs1AwrqUDzRYQLY+kNH+6+QwUZqUTO380WtgSFY\nRcNTK3zDWt6iUbQi+26L4L5BR0u7cULbn7QI8woKqtYTO/R8gXJCSRFudtbu\nn0QERDawqHHh7MH3RC1xaRxP3fWtgUxLJ2XJSjDhaJhsbtySpfeowlfKXtd5\naXeVZ1zCxSVbx7gDkhPpXk0TAeW14kvpcRoQTUOnPl9OKMRMPUO3hKqK9Djj\nArz+idDhk1EX/QroHv8ylv2+RX9WRDN6FgQYxBURYvQjqeg22ygJg9gFLEq3\nxH9vCFnYKIHzNknS2Dc34fZ2aElp6ri2cIcs3WfuhA/CRq09Zm2CucKGqEOa\ngbnUeYREnGLlq8IAk3ZOBsR+4d3nfUG2xPwbna/oAvZYUNTkNBMadpjEXn8p\nDYVJ5lQ1bkvy5b9p1K++vSK34aPS86OXFKOIxRq8LU3bLfBf0huEbk12IU/0\nvPoAYSpxIPfdX9he1F2iAO/C4i6EViQLXefn8y/8WmFRXsH5KMCBt2UnwYCJ\nk13EyGep8/JWd+7NIaljKMgFE9+ipr9FcyGrMMxMJMYZLvak4OVuXtUqiX+a\nB6DU\r\n=tdGn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTpGpLo0m7BFRxzEPmcYggJt3YvfYcipSPFoC4VQ7SbwIhAOyO+vUxQMojmzRsVOMtgXUD3sR5BuXTFFLzGIkClb7f"}]},"maintainers":[{"name":"chpiatt","email":"chris@blocklytics.org"}],"_npmUser":{"name":"chpiatt","email":"chris@blocklytics.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/truffle-test-generator_1.0.2_1582478455018_0.9929367543793615"},"_hasShrinkwrap":false},"1.0.3":{"name":"@blocklytics/truffle-test-generator","author":{"name":"Chris Piatt","url":"chris@blocklytics.org"},"version":"1.0.3","description":"A test file generator for the Truffle framework","bin":{"ttg":"testGen.js"},"keywords":["solidity","truffle","test","generator","ethereum"],"homepage":"https://blocklytics.org","repository":{"type":"git","url":"git+https://github.com/pyython/truffle-test-generator.git"},"license":"MIT","dependencies":{"fs":"0.0.1-security"},"bugs":{"url":"https://github.com/pyython/truffle-test-generator/issues"},"main":"testGen.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"gitHead":"d0f308d14507326a36a087c4a5f16e71a6f38a0f","_id":"@blocklytics/truffle-test-generator@1.0.3","_nodeVersion":"13.6.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-JGfnqd50/aT1oDuW3d93jA/15L90IQpx1cB39n+4CfYx1k3QyKic4GhiFqzYFvnXbdWjz+TGn/1HScwahgkn5w==","shasum":"16c4e85e9f37ae0c660565aa3f134d16aceec549","tarball":"https://registry.npmjs.org/@blocklytics/truffle-test-generator/-/truffle-test-generator-1.0.3.tgz","fileCount":4,"unpackedSize":7132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeU2xSCRA9TVsSAnZWagAA3x8QAJeH4Rp2xvpdlkb4pNoF\n7Z2Yi+OOKETgPoxkwo26xB6qI3kPbzDy2CQX7BIMHZg87+P0KyzF4lk1ytlD\n/boqPghC8WrajSDlyUPpxq42Gscu39bP15WEY3jGL+5p3X/ouiLGSfXGLvji\n0fE3XI90tfrGMxrtlryswmDrSrwSbdiuM4d+N8ATDZYvCnDzq+cihNmiAJru\n3Tu8mSwLZ1XxYlIuMfL32iRgkpHNtaQciMMVkCydX+COcufzlGNHPjeWAfu7\n773OsYR+Jl+FahrjtACGqHTk/Mgw/M6rYqSRl4Or6lwmFj54UI9CQl2OGTsp\nr3Dce15y2O2GNsQ8k384z1WSTmmtonalaG35KD+aIPpihq1aDgqmxuGQdIxH\nkrdsYyFvGK4yZmtHBfFUPuCo3oS6B9YrRUe3fWJKsZcr+KnEjpHZRz7b7imz\nnz0RiA2iKX9lSLl6+qb11SN9/gUIWr0i2onaySFaZ1Mx7y8QMO9DCDPrJMhO\nEjlKQnLPri1URvv0sRzR4i43C/4HNW+jECMWK6OSFYT3arx/nN1jSRQOMoFm\nut3ylPhktgeiqF+qKjhenYcRAVN54UR1TvigmwjIlJ+heUMKW+Ud1PaeOphy\nRnJJClnbh2gyQvArssstDFd3xfHyZgef0xQSMEWN/BxvKlUC/aMsuYQow/LV\ndwtq\r\n=zyoK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB2rd/gPURtPILmojrXxcacTReB9CRsXb/Jn6Al7JDe0AiEAxrND1OFRnsJ+sfHvci/MAppc/TsD1hVQcEpz16zHoJs="}]},"maintainers":[{"name":"chpiatt","email":"chris@blocklytics.org"}],"_npmUser":{"name":"chpiatt","email":"chris@blocklytics.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/truffle-test-generator_1.0.3_1582525522465_0.1256047504530997"},"_hasShrinkwrap":false},"1.0.4":{"name":"@blocklytics/truffle-test-generator","author":{"name":"Chris Piatt","url":"chris@blocklytics.org"},"version":"1.0.4","description":"A test file generator for the Truffle framework","bin":{"ttg":"testGen.js"},"keywords":["solidity","truffle","test","generator","ethereum"],"homepage":"https://blocklytics.org","repository":{"type":"git","url":"git+https://github.com/pyython/truffle-test-generator.git"},"license":"MIT","dependencies":{"fs":"0.0.1-security"},"bugs":{"url":"https://github.com/pyython/truffle-test-generator/issues"},"main":"testGen.js","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"gitHead":"d0f308d14507326a36a087c4a5f16e71a6f38a0f","_id":"@blocklytics/truffle-test-generator@1.0.4","_nodeVersion":"13.6.0","_npmVersion":"6.13.4","dist":{"integrity":"sha512-8TFimslIXFy060pLu2TWgzUgZLHiAndq18haMl5SsEGhFF8WbiV+LY1BULe4qwiubsgf0yvfHVocJnTG+J5AXg==","shasum":"669a91ba4f1ff5c181a230db991694f6352aaeb8","tarball":"https://registry.npmjs.org/@blocklytics/truffle-test-generator/-/truffle-test-generator-1.0.4.tgz","fileCount":4,"unpackedSize":7132,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeU2yRCRA9TVsSAnZWagAAJ5IP/RacqipK89nJuo12NZeS\nj4GOiHcnprdWeId+Vwbc8NpGrDHEW8oaQGRyVuqbLnIL9jQOIiFLsdg+CO7M\nOCFJs+f+KFKAOHQhCiEl0Y2Dksy8yLXzih+gxt2CEmB2cXUZ86lsvwwHVtz7\nFiAh8S+B8cyg//aYm/2LTH9lX7uC3eaywTTYyhQeeD84cACEzwW7ESKo96+n\nfmq7AOebDFvUk5gxVGRXeXIFncieEX+I1Dx5Hd7ENqxItyc/O8KLIrkVwsRT\nIkRsNJ/TT/NVit9Xf/O7axQQlbY404EE5YjQwUb3YMP6+qZEDEskw7KqXyND\nG/YSRDej6dnVVL5Y0Iw0COtCR55sEqTEHwX2FiH7Vm+b4i5AXto9FDQpwCsv\nJCk9uWmaOJRSdxMDfkoN0KN5Y2zzU7M1nzxNQNqtCjKIildaS3Y45yOhgOPr\n962QQ94jk8K2VrH4LIw9uZtA0SLb3Hu7mER0aHmO60Ur+Is6FhPO1FfF/xqt\njG1B3FKExO25bPoORiEtSpQPm1mdG4du99OJNpAhPD3z3sSNPLSij7kDT+Wm\n9Tov025QRdKUuYg8r8K6MU7jdfolKZWuRiyU+GbsaRVY8S2Vu3QcIzvdLleO\nUJzm8+kBWBJK8ttUZhCOiGHRC+QxHy03pDO1ARjFaoT4ile1Kgk7HkNmeNnf\nb11T\r\n=1kwx\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBZKDhm+v5+x4BFJNB8AZkJyygJkY0d/5beQsb4zbh8RAiEAqyZ2TmfSjxQCR6DzWnGGhmlQdu0bC4yrDsn6yCfueKo="}]},"maintainers":[{"name":"chpiatt","email":"chris@blocklytics.org"}],"_npmUser":{"name":"chpiatt","email":"chris@blocklytics.org"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/truffle-test-generator_1.0.4_1582525584774_0.488502779894304"},"_hasShrinkwrap":false}},"time":{"created":"2020-02-23T16:50:12.938Z","1.0.0":"2020-02-23T16:50:13.341Z","modified":"2022-04-04T19:38:02.981Z","1.0.1":"2020-02-23T16:51:41.924Z","1.0.2":"2020-02-23T17:20:55.140Z","1.0.3":"2020-02-24T06:25:22.575Z","1.0.4":"2020-02-24T06:26:24.937Z"},"maintainers":[{"name":"chpiatt","email":"chris@blocklytics.org"}],"description":"A test file generator for the Truffle framework","homepage":"https://blocklytics.org","keywords":["solidity","truffle","test","generator","ethereum"],"repository":{"type":"git","url":"git+https://github.com/pyython/truffle-test-generator.git"},"author":{"name":"Chris Piatt","url":"chris@blocklytics.org"},"bugs":{"url":"https://github.com/pyython/truffle-test-generator/issues"},"license":"MIT","readme":"# Truffle Test Generator\n\nA utility for creating new test files in a Truffle project.\n\n## Install\n\n```\nnpm i @blocklytics/truffle-test-generator --save-dev\n```\n\n## Usage\n\nUse Truffle to compile your contracts first.\n\n```\ntruffle compile\n```\n\nGenerate tests for a contract named MyContract.\n\n```\nnpx ttg MyContract\n```\n\n_Replace MyContract with the name of the contract you want to create tests for._\n\n## How It Works\n\nThe test generator will look at the json files located in the `./build/contracts` directory for the given contract name. As long as that contract exists and has been compiled, a test file will be created for it.\n\nEach test will include a standard template for the beginning of the file, which includes `require`ing the artifact, declaring the contract test, and setting some common account variables.\n\n```javascript\nconst MyChildContract = artifacts.require('MyChildContract')\n\ncontract('MyChildContract', (accounts) => {\n  const maintainer = accounts[0]\n  const user1 = accounts[1]\n  const user2 = accounts[2]\n  const stranger = accounts[3]\n\n  let mychildcontract\n```\n\nWhile reading the contract's json file, it will also generate input parameters for your constructor. However, it will be up to you to update the values as your contract requires.\n\n```javascript\n// Be sure to update these constructor values\nlet _initialParentValue = 0\nlet _initialChildValue = 0\n\nbeforeEach(async () => {\n  mychildcontract = await MyChildContract.new(_initialParentValue, _initialChildValue, {from: maintainer})\n})\n```\n\nAny inherited contracts with external or public functions will have a test stub (as a describe block) created for it.\n\n```javascript\ndescribe('setValue', () => {\n\n})\n```\n\nThis allows you to easily have a structure for your tests and ensure that each external/public method will be tested, provided you write a test for it.\n\nThe test file will be placed in the `test` directory within your Truffle project and named `MyContract_test.js`, where MyContract is the name of the contract. In order to prevent a user from accidentally erasing an existing file, `-new` will be appended to the name and a new file will be created if the filename already exists. If the `-new` file exists, it will be overwritten.","readmeFilename":"README.md"}