{"_id":"ng-bullet","_rev":"4-2bbda9096c54183745bc14dda160f370","name":"ng-bullet","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"ng-bullet","version":"1.0.0","license":"MIT","author":{"name":"nikitai","email":"nikita.yakovenko@gmail.com"},"description":"Angular library which drastically improves execution time of your component's unit tests","keywords":["ng","angular","unit testing","testing","performance","typescript","jasmine","TestBed"],"peerDependencies":{"@angular/common":">=5.0.0","@angular/core":">=5.0.0","jasmine-core":">=2.5.0"},"main":"bundles/ng-bullet.umd.js","module":"fesm5/ng-bullet.js","es2015":"fesm2015/ng-bullet.js","esm5":"esm5/ng-bullet.js","esm2015":"esm2015/ng-bullet.js","fesm5":"fesm5/ng-bullet.js","fesm2015":"fesm2015/ng-bullet.js","typings":"ng-bullet.d.ts","metadata":"ng-bullet.metadata.json","sideEffects":false,"dependencies":{"tslib":"^1.9.0"},"_id":"ng-bullet@1.0.0","_npmVersion":"6.2.0","_nodeVersion":"8.11.3","_npmUser":{"name":"n.yakovenko","email":"nikita.yakovenko@gmail.com"},"dist":{"integrity":"sha512-48g9J436JTQ+sBbVQWpFhWdgtt93/hW+9k0dVgTL8B324a/RWGHDF7PVyKfQe3dyYFqGiDXzkmEjV0Ay/BpN4g==","shasum":"31941bdd704cc33912ebcd1497ca433f6a3cee7b","tarball":"https://registry.npmjs.org/ng-bullet/-/ng-bullet-1.0.0.tgz","fileCount":20,"unpackedSize":134157,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbVDRjCRA9TVsSAnZWagAA68gP/1m+Dsx+oQOri0SFVLEC\nlVDMhiVxihqDSg1iQG/UsGfvLc191fy3/3crmelyR6+fU9LDLWbQKjkBIvsj\nA24rEjHKU6iwUtfhhilNlNq5AoZ+/us3RkgztFuf6+hmEXuE3jdTcd9isv9h\nVlfe2KXXJnbIevS4BFU9QmRY8nnnAD/X0ddnJnrDGa3z6clRSyu+qjs6x0lL\n7NSyQI6blpkRYN70PaU1hvt+1XAUH7fN2KvFqEx3Lxiy7G2rzi1t5/QPOhKx\nIBdB8vfa3jh6Bf9oox14fSOOosGp2lTnzKtSPphwXFoouKBit2J56DkdAdc+\npqhiSsXaezwsj1ynRVFfNaz3yBX/SLeKcCqQwP58FwaG7AmZd+NAl2qgLtyK\ngC5HlnEEz2L8/dnuwaBT1HWjYODk06uPBtsOIc9HfXUkvW67fl1AZE0Pcfn8\nlNo0Pv9lO3ZnvQACDhzflQC9mjJ3ilgVl6I8LLFvtrn+kWm8/jkeVqQKUKNG\nKa2VFU55UYwJCOw3iQTXQznXy/pE7Wx0Xiosn8s4pgkguRgzFDoyir0QNcjM\nxTQUSu/nmhWKyr/RKelIpTeR0s/sa9p0arfJ5aUaSo4Npw+vS04wbcSl6q5K\nKdPNEcoScQnbaQbtY9KcBaigaRpX46FBc23KfikLx5CfRxTMvzuL1FBjsoIC\nQ+QV\r\n=vA19\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCng9pBAX1m5TYdX+bG2ks+Tqt6P9eye8O4dFdUNDYZuwIhANvxv2HaxS/q+6tCT1vDO2cpcfSsBhSCKbvyy+/nIG3L"}]},"maintainers":[{"name":"n.yakovenko","email":"nikita.yakovenko@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ng-bullet_1.0.0_1532245091499_0.27226639932977426"},"_hasShrinkwrap":false},"1.0.1":{"name":"ng-bullet","version":"1.0.1","license":"MIT","author":{"name":"nikitai","email":"nikita.yakovenko@gmail.com"},"description":"Angular library which drastically improves execution time of your component's unit tests","keywords":["ng","angular","unit testing","testing","performance","typescript","jasmine","TestBed"],"peerDependencies":{"@angular/common":">=5.0.0","@angular/core":">=5.0.0","jasmine-core":">=2.5.0"},"main":"bundles/ng-bullet.umd.js","module":"fesm5/ng-bullet.js","es2015":"fesm2015/ng-bullet.js","esm5":"esm5/ng-bullet.js","esm2015":"esm2015/ng-bullet.js","fesm5":"fesm5/ng-bullet.js","fesm2015":"fesm2015/ng-bullet.js","typings":"ng-bullet.d.ts","metadata":"ng-bullet.metadata.json","sideEffects":false,"dependencies":{"tslib":"^1.9.0"},"_id":"ng-bullet@1.0.1","_npmVersion":"6.2.0","_nodeVersion":"8.11.3","_npmUser":{"name":"n.yakovenko","email":"nikita.yakovenko@gmail.com"},"dist":{"integrity":"sha512-fVoqGdQrjV8ifWPAGBRkACNzTcdWi1SAESgOeAGxs3zsPed4HnTNiQT/Isdo58R3iuLYQBs+F177w/NW20cjcg==","shasum":"3d00a2af8edf63adb799b2e846bb7311b8c9f045","tarball":"https://registry.npmjs.org/ng-bullet/-/ng-bullet-1.0.1.tgz","fileCount":20,"unpackedSize":328764,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbVDtJCRA9TVsSAnZWagAAbYQP/iAefZgSrgcCCBvgpxkO\nj+SFV1jPNch2ZzVoz8XxvkM11cm624i4zSsu6iHWGge6jO18gStZ2vISWwrz\ncYkH9w70/KXlPEtOqdBjq5anD0LrQ5DvTMnFlznIsx5Riwltcxg//g9yZSCb\n+Y+HrSoNN3vFQ4q2QjHKFLKoaCU3LLJ2Y+CDCRiLBHkXxzGde47YHf1DmI6e\nprhw6BJPZrzNxoQc1EI9nbftzjT/j2MqdhJLi/U9GWItsQCy9Ep91GY6CgZ3\nh5eimrRpXyjKnXxeIV2f2dSwAwnv1/V9L+GwPTQw4u6VSiNo6XHbGMpgrUV+\n8BQoZ5N1S8gBciwp+ZLBur8yvr5XSVUvX12XdZHPYPB1bPnrZF7UIH3R6ipA\n+x1JKh37z63sY26blyqMJ53HH2tW4Txb/TTuZeh1abpPtio8wWdV/8P6/Ums\nB77mM91gEcN0Nqz7t6S4K0wRGocI/NWaaRxUGbnFm7bV0nP913md0cWvH+oi\n9edK3L7qsu8vCEXFsMwJD1Dhqup/I648oFvXhCM3NcM4WmtX0ZOIytuXsfOH\nujCPk2tt64PRJmMYpBceqNBH50CEdsAeabD21AUUTTRc4Azbtc0MNueqotZ7\nWx1fK5RrWcnICGcviIdC3ya4xWLBn7ySjl1dEV9Xwy8qu78bykhr0L9Rr0/O\n+deA\r\n=X8bf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBi+r+YnpKMN8KtHThunQ+ZTFDLbtHDZToBuN14bORYhAiAJRQ6ePaHCBKBc1Ot+rzPkZkIndTW53csubVcQagsVww=="}]},"maintainers":[{"name":"n.yakovenko","email":"nikita.yakovenko@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ng-bullet_1.0.1_1532246857363_0.9057577242244044"},"_hasShrinkwrap":false},"1.0.2":{"name":"ng-bullet","version":"1.0.2","license":"MIT","author":{"name":"nikitai","email":"nikita.yakovenko@gmail.com"},"description":"Angular library which drastically improves execution time of your component's unit tests","keywords":["ng","angular","unit testing","testing","performance","typescript","jasmine","TestBed"],"peerDependencies":{"@angular/common":">=5.0.0","@angular/core":">=5.0.0","jasmine-core":">=2.5.0"},"main":"bundles/ng-bullet.umd.js","module":"fesm5/ng-bullet.js","es2015":"fesm2015/ng-bullet.js","esm5":"esm5/ng-bullet.js","esm2015":"esm2015/ng-bullet.js","fesm5":"fesm5/ng-bullet.js","fesm2015":"fesm2015/ng-bullet.js","typings":"ng-bullet.d.ts","metadata":"ng-bullet.metadata.json","sideEffects":false,"dependencies":{"tslib":"^1.9.0"},"_id":"ng-bullet@1.0.2","_npmVersion":"6.2.0","_nodeVersion":"8.11.3","_npmUser":{"name":"n.yakovenko","email":"nikita.yakovenko@gmail.com"},"dist":{"integrity":"sha512-PAdMPwOamb1E27jUPQEmH0cxvziNLpgUiQ49olm6GSANhHM7JXRJqgFYO8cZSarfH7xHjJ3Sf5ThdQrW+aQ+fQ==","shasum":"f16064ff389fe9aa82ffac582114721c1d718286","tarball":"https://registry.npmjs.org/ng-bullet/-/ng-bullet-1.0.2.tgz","fileCount":20,"unpackedSize":134343,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbVD3DCRA9TVsSAnZWagAAkaUP/RMk1y3C1TsrOnCKZhzY\nvxZAIxWExvAJ5o8laeQhVP9N3qPF27FCJujYM6eBADE6TJ8L3D+LrOikMz+3\ncCGJ78W5ZXAAqTJ2mu4vTRtyaGukv97rwAIEwTRohDPB0C4NkXJFBuvg+BtC\nD4faSzoLy43peDkHOakt7VefxIvOmyVgCYRTT6UV9hj8mVhJ9gNPZbgwQkcT\nbclqONS1KpoDTYVoHKAcbSVer/2NQ46CbvPGijVanlifdOLkAnja6sGsN/nH\nyF6haxN1UeIPUxii61GzkmIUa13cM+t9Zm8+h8YSuazRD+rnigP+HJq1jxPJ\nJl3SJns0/wR24zGY+hQL++RwNcs9QzjWluVa7QWS/8DHl7z6hbfY3+cxHC/+\nAcSlmbuxVtx4nyLP9iPQNHsctWF+40RzyZlkeHe53HJs8qDdDLfBDTQVd/NR\n+Y+lAHHh2ZsRa2DvXBAWMv5UFKLYUZXvqkMgqOg0kMJUYmpjS0zEKanLZFrt\nHdrfcx8okIOIS2VsXTIwAFNG/TCCv2gIwkFV9v3qAUo2vCH+Gdb/PK+h9FVQ\nJ/JjD9ng+r6CImSsmtGYAVXSuoliELt44enwSbXJy7cJMbfGIfkgLlTRwDjf\n/I8Xe2qLE4UjB0B7JiyI80tTR6+KiFFHVNdiz/YEwA/SU6sCtTqOD/3L2QXj\nz34/\r\n=O6Bv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCUC99zjMYVDAJSeKdLsOEp7AYjcTW33Mo8dJuCrBfyNgIgDHYV96+p149r3rLVWdIKahOzY2gZ7rG5BOLrVpXClqw="}]},"maintainers":[{"name":"n.yakovenko","email":"nikita.yakovenko@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ng-bullet_1.0.2_1532247490992_0.6033557472549804"},"_hasShrinkwrap":false},"1.0.3":{"name":"ng-bullet","version":"1.0.3","license":"MIT","author":{"name":"nikitai","email":"nikita.yakovenko@gmail.com"},"description":"Angular library which drastically improves execution time of your component's unit tests","keywords":["ng","angular","unit testing","testing","performance","typescript","jasmine","TestBed"],"peerDependencies":{"@angular/common":">=5.0.0","@angular/core":">=5.0.0","jasmine-core":">=2.5.0"},"main":"bundles/ng-bullet.umd.js","module":"fesm5/ng-bullet.js","es2015":"fesm2015/ng-bullet.js","esm5":"esm5/ng-bullet.js","esm2015":"esm2015/ng-bullet.js","fesm5":"fesm5/ng-bullet.js","fesm2015":"fesm2015/ng-bullet.js","typings":"ng-bullet.d.ts","metadata":"ng-bullet.metadata.json","sideEffects":false,"dependencies":{"tslib":"^1.9.0"},"_id":"ng-bullet@1.0.3","_npmVersion":"6.2.0","_nodeVersion":"8.11.3","_npmUser":{"name":"n.yakovenko","email":"nikita.yakovenko@gmail.com"},"dist":{"integrity":"sha512-qacsE/w/pLlBxebort1rkrE2B4Vc3idutcpe7tYiHVarz0V6Q5SN8E3d6NUp4UFBMOucpHlCpaASp7qEOsxM1Q==","shasum":"578fd03ac56a1b5ab22c349f18d6e2fd8859a721","tarball":"https://registry.npmjs.org/ng-bullet/-/ng-bullet-1.0.3.tgz","fileCount":20,"unpackedSize":133873,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbVG77CRA9TVsSAnZWagAAyVwP/2wxOTYTk9wGdW9fOQB1\npzLB19jpyBmVaRUNcrV6SSGf9XKJS4ExFO+anheGwP9jsOrEC+n2Fw18clJ3\nRKCl9dZIXEwKOJg/B4jm/KIo36qKgfQCDOXODhlllQ4ct5qOexo6J4tcCUoj\nxREjeIKd/YwWcPEinX96qr7tb2KzZqvL6WjPAOn/IG+91FYKLfbjOB3clemn\nfdRqXqD1lv0B6rW1jQLr8yMsikrLw34J0EkRfhnU3v/d7m1yHmmfq5L4B4mr\nhulXm2MX/2xsWuA/sHsuW3AZNcDHskX4h9VF+9PX7KRnvHW5ty94zw5g71av\nFbZ1MkPk75AVQ+Y4OZRsuWwM6JX1JPVGjYBQ2vwQMw16iLUn706zIvPpmZiD\npJs98RyCXNzXByDAfh32pJEfbW2Pr17dFpK+zLaxXUnbOMLWd3Auru6OAOg6\n1lJ9Iyv5PufcetGiImXn1KcXHavVZiHYVX80HEBDGh9cLzKDlD3yWEh5cL6K\n9vEK1qhK+ituNkBhDyOZVuXilILSI9nQCbk2x+vZhVanm1QokwNmk+c7Ftwl\niYlJra/RKQKXxv9nzxYK4/Zt2WTx9VWCb0+lzYrdvTfS1A5jPV/S8woS5M+V\njWW181QzNYtPeey2d88VeQxAK6ZacQEaL344K6jvuKwzqJDe2LMsBUgfrI0W\nexQH\r\n=Hu/d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHHD7FvjBz8NZEdWByt3Il63EI7dg8WLvPO2Dm+orMp9AiAItwp6mSI9AvrdIpGOOH/XJhK0sCxbDiD6S8do4J4uTQ=="}]},"maintainers":[{"name":"n.yakovenko","email":"nikita.yakovenko@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ng-bullet_1.0.3_1532260091742_0.4237258710629621"},"_hasShrinkwrap":false}},"time":{"created":"2018-07-22T07:38:11.498Z","1.0.0":"2018-07-22T07:38:11.635Z","modified":"2022-05-10T15:49:04.057Z","1.0.1":"2018-07-22T08:07:37.453Z","1.0.2":"2018-07-22T08:18:11.069Z","1.0.3":"2018-07-22T11:48:11.851Z"},"maintainers":[{"name":"n.yakovenko","email":"nikita.yakovenko@gmail.com"}],"description":"Angular library which drastically improves execution time of your component's unit tests","keywords":["ng","angular","unit testing","testing","performance","typescript","jasmine","TestBed"],"author":{"name":"nikitai","email":"nikita.yakovenko@gmail.com"},"license":"MIT","readme":"# ng-bullet\r\n\r\n**Bullet** is a library which enhances your unit testing experience with Angular `TestBed`, greatly increasing execution speed of your tests.\r\n\r\nBut how does it do that?\r\n\r\nMost of the time our angular unit tests for components are configured in the following way:\r\n``` typescript\r\n  beforeEach(async(() => {\r\n        // a really simplified example of TestBed configuration\r\n        TestBed.configureTestingModule({\r\n            declarations: [ /*list of components goes here*/ ],\r\n            imports: [ /* list of providers goes here*/ ]\r\n        })\r\n        .compileComponents();\r\n  }));\r\n```\r\nThis is the common approach of doing that and you will see exactly the same approach while reading Angular documentation or watching Angular courses.\r\n\r\nHowever what it also means is that Angular will re-compile everything we used to configure our `TestBed` for every test in a suite, thus increasing the overall test execution time.\r\n\r\nWith **ng-bullet** the previous code snippet will look like this:\r\n``` typescript\r\n    import { configureTestSuite } from 'ng-bullet';\r\n    ...\r\n    configureTestSuite(() => {\r\n        TestBed.configureTestingModule({\r\n            declarations: [ /*list of components goes here*/ ],\r\n            imports: [ /* list of providers goes here*/ ]\r\n        })\r\n    });\r\n```\r\nWe basically just replaced your code snippet with TestBed configuration on `configureTestSuite` fucntion call. No need to call `compileComponents` explicitly. After this\r\n**ng-bullet** will ensure for you that components were compiled only once, still providing all the isolation for your tests and creating new instances of components / services / etc for every test.\r\n\r\n**ng-bullet** also provides 2 handful functions to spin up your component's instances.\r\n```typescript\r\ncreateTestContext: <T>(component: Type<T>) => TestCtx<T>;\r\n```\r\nwhich creates TestCtx instance for the Angular Component which is not initialized yet (no ngOnInit called). Use case: you can override Component's providers before lifetime hooks were called.\r\n\r\nAnd\r\n\r\n```typescript\r\ncreateStableTestContext: <T>(component: Type<T>) => Promise<TestCtx<T>>;\r\n```\r\n\r\nwhich is exactly the same as function above, but this one waits till fixture becomes stable.\r\n\r\nBoth of them return `TestCtx` instance which is a wrapper around `ComponentFixture`, which simplifies your access to some most commonly used features of `ComponentFixture`.\r\n\r\nSo don't hesitate and give a try ;)\r\n\r\n## Performance benefits\r\nThe performance gain depends heavily on the number of tests in the suite and the number of components and modules you imported / declared. The more tests you have the bigger will be your benefit. With a really fat configurations it may come close to be N times faster, where N is the number of tests in the suite.\r\n\r\n\r\nA small comparison from a real project.\r\n\r\nThis is what it takes to run ~1400 tests completely without using **ng-bullet**:\r\n\r\n![test results before ng-bullet](https://github.com/topnotch48/ng-bullet-workspace/blob/master/projects/ng-bullet/before.png?raw=true)\r\n\r\nAnd this is how it looks like after most of the suites were updated with **ng-bullet** usage (there are some suites which are still run on a raw `TestBed`):\r\n\r\n![test results after ng-bullet](https://github.com/topnotch48/ng-bullet-workspace/blob/master/projects/ng-bullet/after.png?raw=true)\r\n\r\nSo in this case 300 % speed increase gained.\r\n\r\n## Installation\r\n`npm install ng-bullet` or `yarn add ng-bullet`\r\n","readmeFilename":"README.md"}