{"_id":"isparta-loader","_rev":"441193","name":"isparta-loader","description":"isparta instrumenter loader for webpack","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"deepsweet","email":""}],"time":{"modified":"2021-08-05T06:34:51.000Z","created":"2015-03-17T09:45:06.171Z","2.0.0":"2015-11-19T02:58:07.447Z","1.0.0":"2015-09-18T07:21:49.401Z","0.2.0":"2015-04-05T09:15:25.149Z","0.1.0":"2015-03-17T09:45:06.171Z"},"users":{"russomi":true},"author":{"name":"Kir Belevich","email":"kir@soulshine.in","url":"https://github.com/deepsweet"},"repository":{"type":"git","url":"git+https://github.com/deepsweet/isparta-loader.git"},"versions":{"2.0.0":{"name":"isparta-loader","version":"2.0.0","description":"isparta instrumenter loader for webpack","keywords":["webpack","loader","isparta","istanbul","coverage"],"homepage":"https://github.com/deepsweet/isparta-loader","repository":{"type":"git","url":"git+https://github.com/deepsweet/isparta-loader.git"},"author":{"name":"Kir Belevich","email":"kir@soulshine.in","url":"https://github.com/deepsweet"},"main":"index.js","files":["index.js"],"dependencies":{"isparta":"4.x.x"},"engines":{"node":">=0.10.0"},"license":"WTFPL","gitHead":"236bcf295affbf27e4a96766dcf4c123e875cb54","bugs":{"url":"https://github.com/deepsweet/isparta-loader/issues"},"_id":"isparta-loader@2.0.0","scripts":{},"_shasum":"4425f496c93f765bbceb4dd938576da307566ed1","_from":".","_npmVersion":"3.4.1","_nodeVersion":"5.1.0","_npmUser":{"name":"deepsweet","email":"kir@soulshine.in"},"dist":{"shasum":"4425f496c93f765bbceb4dd938576da307566ed1","size":1624,"noattachment":false,"key":"/isparta-loader/-/isparta-loader-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/isparta-loader/download/isparta-loader-2.0.0.tgz"},"maintainers":[{"name":"deepsweet","email":""}],"directories":{},"publish_time":1447901887447,"_cnpm_publish_time":1447901887447,"deprecated":"Package is deprecated, use https://github.com/deepsweet/istanbul-instrumenter-loader","_hasShrinkwrap":false},"1.0.0":{"name":"isparta-loader","version":"1.0.0","description":"isparta instrumenter loader for webpack","keywords":["webpack","loader","isparta","istanbul","coverage"],"homepage":"https://github.com/deepsweet/isparta-loader","repository":{"type":"git","url":"git+https://github.com/deepsweet/isparta-loader.git"},"author":{"name":"Kir Belevich","email":"kir@soulshine.in","url":"https://github.com/deepsweet"},"main":"index.js","files":["index.js"],"dependencies":{"isparta":"3.x.x"},"engines":{"node":">=0.10.0"},"license":"WTFPL","gitHead":"937451744de9b59872e41d699affc133d7a96512","bugs":{"url":"https://github.com/deepsweet/isparta-loader/issues"},"_id":"isparta-loader@1.0.0","scripts":{},"_shasum":"f65859c5377baf023a208b5760558269a778e192","_from":".","_npmVersion":"3.3.4","_nodeVersion":"0.12.7","_npmUser":{"name":"deepsweet","email":"kir@soulshine.in"},"dist":{"shasum":"f65859c5377baf023a208b5760558269a778e192","size":1583,"noattachment":false,"key":"/isparta-loader/-/isparta-loader-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/isparta-loader/download/isparta-loader-1.0.0.tgz"},"maintainers":[{"name":"deepsweet","email":""}],"directories":{},"publish_time":1442560909401,"_cnpm_publish_time":1442560909401,"deprecated":"Package is deprecated, use https://github.com/deepsweet/istanbul-instrumenter-loader","_hasShrinkwrap":false},"0.2.0":{"name":"isparta-loader","version":"0.2.0","description":"isparta instrumenter loader for webpack","keywords":["webpack","loader","isparta","istanbul","coverage"],"homepage":"https://github.com/deepsweet/isparta-loader","repository":{"type":"git","url":"git://github.com/deepsweet/isparta-loader.git"},"author":{"name":"Kir Belevich","email":"kir@soulshine.in","url":"https://github.com/deepsweet"},"main":"index.js","dependencies":{"isparta":"3.x.x","loader-utils":"0.x.x","lodash.assign":"3.x.x"},"peerDependencies":{"webpack":"1.x.x"},"engines":{"node":">=0.10.0"},"license":"WTFPL","gitHead":"27093600f86be0baa4641309574b5d854f543de5","bugs":{"url":"https://github.com/deepsweet/isparta-loader/issues"},"_id":"isparta-loader@0.2.0","scripts":{},"_shasum":"2875b3ce69258cc24627862342adbf4bb415bcf5","_from":".","_npmVersion":"2.7.6","_nodeVersion":"0.12.2","_npmUser":{"name":"deepsweet","email":"kir@soulshine.in"},"maintainers":[{"name":"deepsweet","email":""}],"dist":{"shasum":"2875b3ce69258cc24627862342adbf4bb415bcf5","size":1595,"noattachment":false,"key":"/isparta-loader/-/isparta-loader-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/isparta-loader/download/isparta-loader-0.2.0.tgz"},"directories":{},"publish_time":1428225325149,"_cnpm_publish_time":1428225325149,"deprecated":"Package is deprecated, use https://github.com/deepsweet/istanbul-instrumenter-loader","_hasShrinkwrap":false},"0.1.0":{"name":"isparta-loader","version":"0.1.0","description":"isparta instrumenter loader for webpack","keywords":["webpack","loader","isparta","istanbul","coverage"],"homepage":"https://github.com/deepsweet/isparta-loader","repository":{"type":"git","url":"git://github.com/deepsweet/isparta-loader.git"},"author":{"name":"Kir Belevich","email":"kir@soulshine.in","url":"https://github.com/deepsweet"},"main":"index.js","dependencies":{"isparta":"2.2.x","loader-utils":"0.x.x","lodash.assign":"3.x.x"},"peerDependencies":{"webpack":"1.x.x"},"engines":{"node":">=0.10.0"},"license":"WTFPL","gitHead":"742602f4d109f858e2ad48b494fde81f6f9dd764","bugs":{"url":"https://github.com/deepsweet/isparta-loader/issues"},"_id":"isparta-loader@0.1.0","scripts":{},"_shasum":"0fc1dd54d5cc8dffcf7e21a1d1543dcdb4f4d554","_from":".","_npmVersion":"2.7.3","_nodeVersion":"0.12.0","_npmUser":{"name":"deepsweet","email":"kir@soulshine.in"},"maintainers":[{"name":"deepsweet","email":""}],"dist":{"shasum":"0fc1dd54d5cc8dffcf7e21a1d1543dcdb4f4d554","size":1614,"noattachment":false,"key":"/isparta-loader/-/isparta-loader-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/isparta-loader/download/isparta-loader-0.1.0.tgz"},"directories":{},"publish_time":1426585506171,"_cnpm_publish_time":1426585506171,"deprecated":"Package is deprecated, use https://github.com/deepsweet/istanbul-instrumenter-loader","_hasShrinkwrap":false}},"readme":"## isparta instrumenter loader for [webpack](https://webpack.github.io/)\n\n[![npm](http://img.shields.io/npm/v/isparta-loader.svg?style=flat-square)](https://www.npmjs.org/package/isparta-loader)\n[![deps](http://img.shields.io/david/deepsweet/isparta-loader.svg?style=flat-square)](https://david-dm.org/deepsweet/isparta-loader)\n\nInstrument Babel code with [isparta](https://github.com/douglasduteil/isparta) for subsequent code coverage reporting.\n\n### Install\n\n```sh\n$ npm i -D isparta-loader\n```\n\n### Setup\n\n#### References\n\n* [Using loaders](https://webpack.github.io/docs/using-loaders.html)\n* [karma-webpack](https://github.com/webpack/karma-webpack#karma-webpack)\n* [karma-coverage](https://github.com/karma-runner/karma-coverage#configuration)\n\n#### Project structure\n\nLet's say you have the following:\n\n```\n├── src/\n│   └── components/\n│       ├── bar/\n│       │   └── index.js\n│       └── foo/\n│           └── index.js\n└── test/\n    └── src/\n        └── components/\n            └── foo/\n                └── index.js\n```\n\nTo create a code coverage report for all components (even for those for which you have no tests yet) you have to require all the 1) sources and 2) tests. Something like it's described in [\"alternative usage\" of karma-webpack](https://github.com/webpack/karma-webpack#alternative-usage):\n\n#### test/index.js\n\n```js\n// require all `test/components/**/index.js`\nconst testsContext = require.context('./src/components/', true, /index\\.js$/);\n\ntestsContext.keys().forEach(testsContext);\n\n// require all `src/components/**/index.js`\nconst componentsContext = require.context('../src/components/', true, /index\\.js$/);\n\ncomponentsContext.keys().forEach(componentsContext);\n```\n\nThis file will be the only entry point for Karma:\n\n#### karma.conf.js\n\n```js\nconfig.set({\n    …\n    files: [\n        'test/index.js'\n    ],\n    preprocessors: {\n        'test/index.js': 'webpack'\n    },\n    webpack: {\n        …\n        module: {\n            preLoaders: [\n                // transpile all files except testing sources with babel as usual\n                {\n                    test: /\\.js$/,\n                    exclude: [\n                        path.resolve('src/components/'),\n                        path.resolve('node_modules/')\n                    ],\n                    loader: 'babel'\n                },\n                // transpile and instrument only testing sources with isparta\n                {\n                    test: /\\.js$/,\n                    include: path.resolve('src/components/'),\n                    loader: 'isparta'\n                }\n            ]\n        }\n        …\n    },\n    reporters: [ 'progress', 'coverage' ],\n    coverageReporter: {\n        type: 'text'\n    },\n    …\n});\n```\n\n### License\n[WTFPL](http://www.wtfpl.net/wp-content/uploads/2012/12/wtfpl-strip.jpg)\n","_attachments":{},"homepage":"https://github.com/deepsweet/isparta-loader","bugs":{"url":"https://github.com/deepsweet/isparta-loader/issues"},"license":"WTFPL"}