{"_id":"karma-istanbul-preprocessor","_rev":"105-9882c53fd04800cc2c5e9c802621b548","name":"karma-istanbul-preprocessor","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"karma-istanbul-preprocessor","version":"0.0.1","keywords":["karma-preprocessor","karma-plugin","istanbul","coverage"],"author":{"name":"Anil Kulkarni"},"license":"MIT","_id":"karma-istanbul-preprocessor@0.0.1","maintainers":[{"name":"textio","email":"admin@textio.com"}],"homepage":"https://github.com/textioHQ/karma-istanbul-preprocessor#readme","bugs":{"url":"https://github.com/textioHQ/karma-istanbul-preprocessor/issues"},"dist":{"shasum":"0ea5a9d43cd0b1bc4783d1a2627041b952f4bd20","tarball":"https://registry.npmjs.org/karma-istanbul-preprocessor/-/karma-istanbul-preprocessor-0.0.1.tgz","integrity":"sha512-a6b5kZAiUu3R6OLqS8gVNB5JuvxwztSAhcEAbRgDDzvUwQ7iX/qr1W4MOwzsndl9hJNmNaZ0Tw6LhsLotyjlAg==","signatures":[{"sig":"MEUCIEm/h7KO8HjBYAKTL/icSp2/oqVImjzjG1I6e0jFiHDpAiEApcEM9YlIPckUdGEoSOPUdUEuPBE3TB7Vy7s5Jbo/WBI=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"0ea5a9d43cd0b1bc4783d1a2627041b952f4bd20","gitHead":"a7556d6cedbd034b8f464ce90a259417fd699390","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"textio","email":"admin@textio.com"},"repository":{"url":"git+https://github.com/textioHQ/karma-istanbul-preprocessor.git","type":"git"},"_npmVersion":"3.9.3","description":"Instrument code with istanbul without causing conflict with karma-coverage","directories":{},"_nodeVersion":"5.11.1","dependencies":{"istanbul":"^0.4.3"},"_npmOperationalInternal":{"tmp":"tmp/karma-istanbul-preprocessor-0.0.1.tgz_1466282547670_0.02069818740710616","host":"packages-16-east.internal.npmjs.com"}},"0.0.2":{"name":"karma-istanbul-preprocessor","version":"0.0.2","keywords":["karma-preprocessor","karma-plugin","istanbul","coverage"],"author":{"name":"Anil Kulkarni"},"license":"MIT","_id":"karma-istanbul-preprocessor@0.0.2","maintainers":[{"name":"textio","email":"admin@textio.com"}],"homepage":"https://github.com/textioHQ/karma-istanbul-preprocessor#readme","bugs":{"url":"https://github.com/textioHQ/karma-istanbul-preprocessor/issues"},"dist":{"shasum":"6965116c3b4c0b9d4ff62cb8b924349372be1eff","tarball":"https://registry.npmjs.org/karma-istanbul-preprocessor/-/karma-istanbul-preprocessor-0.0.2.tgz","integrity":"sha512-julkKCMZPKMoUHTLlPyouxgyNTU56cHPZVvUCmChJVo89ikYxOmjXVZ8xYC6fLx8AKoIJ/MLM/st3voc6Yv5Rw==","signatures":[{"sig":"MEYCIQCOAOO+L6sRF4oY4MzqKFCSDUwhVljl9VeD5FYbdyan7gIhALSy96Bk5dnMeKjhlfgf8ADxJXCLEVdjMZCZQlhkpcRn","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"index.js","_from":".","_shasum":"6965116c3b4c0b9d4ff62cb8b924349372be1eff","gitHead":"e09b4db5c8268d58e350991bcf5e504fe55e646f","scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"_npmUser":{"name":"textio","email":"admin@textio.com"},"repository":{"url":"git+https://github.com/textioHQ/karma-istanbul-preprocessor.git","type":"git"},"_npmVersion":"3.9.3","description":"Instrument code with istanbul without causing conflict with karma-coverage","directories":{},"_nodeVersion":"5.11.1","dependencies":{"istanbul":"^0.4.3"},"_npmOperationalInternal":{"tmp":"tmp/karma-istanbul-preprocessor-0.0.2.tgz_1466282750108_0.6890179323963821","host":"packages-12-west.internal.npmjs.com"}}},"time":{"created":"2016-06-18T20:42:30.187Z","modified":"2026-07-02T17:22:02.286Z","0.0.1":"2016-06-18T20:42:30.187Z","0.0.2":"2016-06-18T20:45:50.659Z"},"bugs":{"url":"https://github.com/textioHQ/karma-istanbul-preprocessor/issues"},"author":{"name":"Anil Kulkarni"},"license":"MIT","homepage":"https://github.com/textioHQ/karma-istanbul-preprocessor#readme","keywords":["karma-preprocessor","karma-plugin","istanbul","coverage"],"repository":{"url":"git+https://github.com/textioHQ/karma-istanbul-preprocessor.git","type":"git"},"description":"Instrument code with istanbul without causing conflict with karma-coverage","maintainers":[{"email":"admin@textio.com","name":"textio-circle"},{"email":"jensen@textio.com","name":"jensen_textio"},{"email":"bobby@textio.com","name":"bobby_textio"},{"email":"olivia@textio.com","name":"oliviagunton"},{"email":"mattie@textio.com","name":"mattiejean"},{"email":"brad@textio.com","name":"brad2"},{"email":"gregory@textio.com","name":"textio-greg"},{"email":"colin@textio.com","name":"colinjeanne-textio"}],"readme":"# karma-istanbul-preprocessor\r\nA small preprocessor to help merge different instrumentation runners into an aggregate tool like [karma-coverage](https://github.com/karma-runner/karma-coverage).\r\n\r\n## Should you use this plugin?\r\nTry the standard tools like `karma-coverage` or `browserify-istanbul`. Come here when you find you need to run both at the same time :-)\r\n## Installation\r\n`npm install --save-dev karma-istanbul-preprocessor`\r\n\r\n## Usage\r\nAdd `istanbul` to your `karma.conf.js` like so:\r\n```\r\n// karma.conf.js\r\nmodule.exports = function(config) {\r\n  config.set({\r\n      preprocessors: {\r\n          // Source files that you want to add instrumentation for\r\n          '**/*.js': ['istanbul'],\r\n      },\r\n  });\r\n```\r\n\r\n## Now what?\r\nThis plugin does not display coverage or do anything other than add instrumentation. You still probably want to set up karma-coverage like normal,\r\nexcept do NOT add the `coverage` preprocessor.\r\n\r\n## Contributing\r\nOpen an issue or a PR, and we'll go from there.\r\n\r\n## Why?\r\nFor a bit more of a long-form answer: I was debugging into why generating HTML coverage was failing. \r\nIt turns out that when you use `karma-coverage`, it keeps track of a `sourceStore` and only picks up files it has seen in the preprocessor stage.\r\n\r\nNow, if you have some other tool that also runs through instrumented code (`browserify-istanbul` in my case), then the code inside `karma-coverage` passes in an explicit cache of files.\r\nThe HTML renderer tries to grab the source file that `browserify-istanbul` has parsed over, but can't because it's not in the cache that `karma-coverage` has seen.\r\nLong story short, you end up with a Saturday morning spent trying to get both tools to play with each other and that's why this plugin exists.\r\n\r\nSpecifically, if you end up with a stack like this, then this tool may be useful:\r\n```\r\nTypeError: Cannot read property 'split' of undefined\r\n    at HtmlReport.Report.mix.writeDetailPage (/Users/anil/textio/frontend/node_modules/istanbul/lib/report/html.js:412:30)\r\n    at /Users/anil/textio/frontend/node_modules/istanbul/lib/report/html.js:489:26\r\n    at SyncFileWriter.extend.writeFile (/Users/anil/textio/frontend/node_modules/istanbul/lib/util/file-writer.js:57:9)\r\n    at FileWriter.extend.writeFile (/Users/anil/textio/frontend/node_modules/istanbul/lib/util/file-writer.js:147:23)\r\n    at /Users/anil/textio/frontend/node_modules/istanbul/lib/report/html.js:488:24\r\n    at Array.forEach (native)\r\n    at HtmlReport.Report.mix.writeFiles (/Users/anil/textio/frontend/node_modules/istanbul/lib/report/html.js:482:23)\r\n    at /Users/anil/textio/frontend/node_modules/istanbul/lib/report/html.js:484:22\r\n    at Array.forEach (native)\r\n    at HtmlReport.Report.mix.writeFiles (/Users/anil/textio/frontend/node_modules/istanbul/lib/report/html.js:482:23)\r\n    at HtmlReport.Report.mix.writeReport (/Users/anil/textio/frontend/node_modules/istanbul/lib/report/html.js:566:14)\r\n    at writeReport (/Users/anil/textio/frontend/node_modules/karma-coverage/lib/reporter.js:62:16)\r\n    at /Users/anil/textio/frontend/node_modules/karma-coverage/lib/reporter.js:290:11\r\n    at /Users/anil/textio/frontend/node_modules/karma/lib/helper.js:82:7\r\n    at FSReqWrap.oncomplete (fs.js:82:15)\r\n```\r\n","readmeFilename":"README.md"}