{"_id":"@bigteam/mocha-classes","_rev":"1-3affc4ac44fa6406d1765ae6134e381d","name":"@bigteam/mocha-classes","dist-tags":{"latest":"0.1.3"},"versions":{"0.1.3":{"version":"0.1.3","name":"@bigteam/mocha-classes","description":"An experiment to allow writing Mocha unit tests with es2015 classes and es2016 decorators","main":"lib/index.js","scripts":{"test":"mocha --require babel-hook","compile":"npm-run-all compile:clean compile:babel","compile:clean":"rimraf lib && mkdir lib","compile:babel":"babel -d lib/ src/","prepublish":"npm run compile"},"author":{"name":"Andrew Levine, BigTeam.co"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/BigTeamDotCo/mocha-classes.git"},"devDependencies":{"babel":"^5.8.29","chai":"^3.4.0","mocha":"^2.3.3","npm-run-all":"^4.0.2","rimraf":"^2.6.1"},"gitHead":"70ba26987da00f3833624f8f11008b45c43bbb6e","bugs":{"url":"https://github.com/BigTeamDotCo/mocha-classes/issues"},"homepage":"https://github.com/BigTeamDotCo/mocha-classes#readme","_id":"@bigteam/mocha-classes@0.1.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.4","_npmUser":{"name":"dewwwald","email":"laubscher.dewald@gmail.com"},"dist":{"integrity":"sha512-KxqLI+LQc6dyTInlluRD8xYRiNTsj/7LAQOqXEuCKGZT3tHwPgxdIGEZpIp7BgYVAANv0l6Kz+1W10lHmFNmlg==","shasum":"911afd0e0cd7a18f85ca524de8f4fd5ffcc2396d","tarball":"https://registry.npmjs.org/@bigteam/mocha-classes/-/mocha-classes-0.1.3.tgz","fileCount":6,"unpackedSize":7121,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcLCKbCRA9TVsSAnZWagAAPO8P+wU5FOk3CEZyz2IRQXSK\n25iT+m2haZF4s0jxXdSfYDQgq7jo1kpPSMuehVEEkPA68ZJNo72PNw23YrFo\nMtRnZtwLE2xYq4fG6CQpfdL2oL+kT8MeEor8puK8lV46j6++aowZOnCRw5ze\nabO8vNlCehEhizrherNh2v8iRtDibMxvDIrsrJb7zlUm5G/DReUjvxOTFSKV\n5ZHPeTcZu+tjSOF52SQYlEZ6sm0qX4m87uBAXBXDNL7n31BUANDcMw5eqzDT\nGvQRK9yantMA0u+H4/X5dFHJ74kZ3HjUBFXqFJvmPyWhyqO9cvz8Tv4CWtUl\nnxmyyAbInncD3Ux7fkQPXNmhBsj0cx9A5peja/AXADBewoilnR9AHX/ikC7F\nJjf1zWi4QqlT4PguGw5XBQEF/hTQVAIESVe0+tWCNVqGgEyqJUySlXM6LAcs\nU4xk5fMn644tdJD5MwAyq2iWBJEY4GJjlQECYs59GW2yKSkY70X1UhcSZ3qQ\nfSVhis1/5hg/A3osJUFuyka9vNncdlfsRycKB34QgHxbbUiuRSowl9s4oj7W\nNZ1mTM7cvbBQT0c8BqU/6X/sAcw9s4NkaRSs6tyDuKaejElzFcITURgXQQuy\nYXRmJj0K/LXYZZzBPGXEe4V6dc9PGJW/V6ItmAcIYW4AO7acpjiZpdOSMRIs\nKrUW\r\n=rioa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCymPzDUFoJ43iGEkrE0A2GUk8QqDXiIfezTK5oBWqXcgIhAJTapjQF3rthmhKv4Y9x4t66MHU+mHqwbt8V6tFAyeRQ"}]},"maintainers":[{"name":"bigteam-admin","email":"info@bigteam.co"},{"name":"dewwwald","email":"laubscher.dewald@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/mocha-classes_0.1.3_1546396314365_0.776186244706518"},"_hasShrinkwrap":false}},"time":{"created":"2019-01-02T02:31:54.241Z","0.1.3":"2019-01-02T02:31:54.546Z","modified":"2022-04-04T18:46:59.827Z"},"maintainers":[{"name":"bigteam-admin","email":"info@bigteam.co"},{"name":"dewwwald","email":"laubscher.dewald@gmail.com"}],"description":"An experiment to allow writing Mocha unit tests with es2015 classes and es2016 decorators","homepage":"https://github.com/BigTeamDotCo/mocha-classes#readme","repository":{"type":"git","url":"git+https://github.com/BigTeamDotCo/mocha-classes.git"},"author":{"name":"Andrew Levine, BigTeam.co"},"bugs":{"url":"https://github.com/BigTeamDotCo/mocha-classes/issues"},"license":"MIT","readme":"# Mocha Classes\n\nA simple proof of concept to explore using [ES2015 Classes](http://www.2ality.com/2015/02/es6-classes-final.html) and [ES2016 Decorators](https://github.com/wycats/javascript-decorators) to help write more declarative unit tests with [Mocha](https://mochajs.org/). Loosely insprired by the [NUnit](http://www.nunit.org/index.php?p=home) syntax.\n\n**Warning:** [Decorators currently aren't supported in Babel 6, due to recent changes in the proposal](https://phabricator.babeljs.io/T2645#65806). Until that's addressed, you'll need to use Babel 5 if you plan to use decorators in your project.\n\n## Install\n\n```bash\nnpm install --save-dev mocha-classes\n```\n\n## Features\n- Write tests using ES2015 Classes\n- Supports inherited life-cycle hooks (`before`, `beforeEach`, etc) from subclasses\n\n## Example Test\n\nNote: A more thorough example can be seen in `test/decorators-example.spec.js`\n\n```javascript\nimport {expect} from 'chai';\nimport {bdd, runTest} from 'mocha-classes';\n\n@bdd.describe('ES2015 Classes and ES2016 Decorators with Mocha')\nclass MyUnitTest {\n    @bdd.it('should pass')\n    sampleTestCase() {\n        expect(true).to.be.true;\n    }\n}\n\nrunTest(new MyUnitTest());\n```\n\n## Is this really a good idea?\n\nHonestly, that's a great question. As of this time, I haven't identified much value that this decorator/class based test syntax provides. Only time will tell...\n\n\n## Possible Benefits\n\n- Less nesting, due to description of test not being a param to `describe`.\n- Encourages more descriptive function names for life-cycle hooks like `before` and `after`  (real world Mocha tests frequently use anon functions to avoid line length limits in projects), which leads to more descriptive stack traces.\n\n## Possible Future Enhancements\n\n1. Make argument to `describe` and `it` decorators optional, and infer test name from fn name when not provided (similar to NUnit)\n","readmeFilename":"README.md"}