{"_id":"@bdwain/webpack-jasmine-html-runner-plugin","name":"@bdwain/webpack-jasmine-html-runner-plugin","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@bdwain/webpack-jasmine-html-runner-plugin","version":"1.0.0","description":"Use webpack with interactive browser testing","main":"index.js","scripts":{"test":"eslint index.js lib"},"repository":{"type":"git","url":"git+https://github.com/bdwain/webpack-jasmine-html-runner-plugin.git"},"keywords":["webpack","jasmine","html","spec","babel","testing"],"author":{"name":"aixigo AG"},"license":"MIT","bugs":{"url":"https://github.com/bdwain/webpack-jasmine-html-runner-plugin/issues"},"homepage":"https://github.com/bdwain/webpack-jasmine-html-runner-plugin#readme","dependencies":{"glob":"^7.1.7","jsondiffpatch":"^0.4.1","sourcemapped-stacktrace":"^1.1.11"},"peerDependencies":{"jasmine-core":"^2.5.2 || ^3.0.0","webpack":"^4.0.0 || ^5.0.0"},"devDependencies":{"eslint":"^7.26.0","eslint-config-laxarjs":"^2.0.0"},"gitHead":"36dedd750aa243104fa999192455304dcf3799cf","_id":"@bdwain/webpack-jasmine-html-runner-plugin@1.0.0","_nodeVersion":"16.17.0","_npmVersion":"7.10.0","dist":{"integrity":"sha512-4heJpAQwszQ1qa1YGGaTTuHWJN9qevk7OYfjmk19Evn/lrgq3xWxsil2T7iRjisuj3Nj4XIkJqt6zFVWpUvMKw==","shasum":"8787df4f317d235f7a9b7e6161d011133f2f7f8d","tarball":"https://registry.npmjs.org/@bdwain/webpack-jasmine-html-runner-plugin/-/webpack-jasmine-html-runner-plugin-1.0.0.tgz","fileCount":134,"unpackedSize":7485815,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEMxtyDV0lEV0tpMeXRDI49yUwuAsdm5qmiF8Ac4G3tAIhAIz/xv2gpXG8rmP0cy8X0jJVvI6pMQocWbVepmIcjtX4"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjXBlDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrOSg//YpZbq2+IbuNc/J99LCx/nV0K5bDCE6Q3sCYBXnvMLcE6kEHf\r\njPp+w8YNn9r5UveArbs2HYAMAFT1IYtJlMxm9RLm4TkUts3UMPISKvhX6i4d\r\nU2vwnyloewNJkRXdwr0U+CmSrUBGHzVYb5R85SDqJKZT+ydXFJwG+Uzk6b4p\r\ngaWW2RPKeYeNYrUmachQCPxe8sltu4IXdcLmFQo1YLCKtBLOAW57oy9pQDUQ\r\nr0UhXeHALKasuyZh0z+pjTaVJUvHV6/e9xdQQOTVIYT1fpBivzxLUBLairLL\r\nHJcH1MiY7bXiEH1r/5MDcnsXrXcJ06xruq4CbTmH+iHFgQtdHcSBKtdKcG43\r\nzii8AVefI+PQXg9oSP3MlG1+rFxCOBv1LZka0bboJAnT3QXm7bnqxoKGX6Hn\r\nsUXSra6jbW8qnJZOOlewJggm5lzoN218JKOnM1d3MmlCkpIpvKB7MRwVOJK7\r\nLJBCTkN1LEtWEBfIT5C2jcqMRYDljLI6kAq9EGI+lsp8kTyPlmH11cprbIzN\r\nIaIW3OLQcTMsYZGPOw87tZlipi+Go2vFJfn2lkMYNY59B+QBuVT7srRIkgNE\r\nnw7ZPend662A07bKmYqH48YfrUez164JkmKxXW+XuwkX1Ar9Yl1XXWG3hekN\r\n2jYQ+Ugu8THm/Sn1QWgOvuuWOSfd7XVpPRI=\r\n=3887\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"bdwain","email":"bryandwain@gmail.com"},"directories":{},"maintainers":[{"name":"bdwain","email":"bryandwain@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/webpack-jasmine-html-runner-plugin_1.0.0_1666980163160_0.47713411262865457"},"_hasShrinkwrap":false}},"time":{"created":"2022-10-28T18:02:43.072Z","1.0.0":"2022-10-28T18:02:43.474Z","modified":"2022-10-28T18:02:43.631Z"},"maintainers":[{"name":"bdwain","email":"bryandwain@gmail.com"}],"description":"Use webpack with interactive browser testing","homepage":"https://github.com/bdwain/webpack-jasmine-html-runner-plugin#readme","keywords":["webpack","jasmine","html","spec","babel","testing"],"repository":{"type":"git","url":"git+https://github.com/bdwain/webpack-jasmine-html-runner-plugin.git"},"author":{"name":"aixigo AG"},"bugs":{"url":"https://github.com/bdwain/webpack-jasmine-html-runner-plugin/issues"},"license":"MIT","readme":"# webpack-jasmine-html-runner-plugin\n\nNOTE: This is a fork of [the original](https://github.com/LaxarJS/webpack-jasmine-html-runner-plugin) with webpack 5 support.\n\n> *interactive in-browser testing* with webpack and Jasmine\n\nThis webpack plugin helps to use  [webpack](http://webpack.github.io/) and the [webpack-dev-server](https://webpack.github.io/docs/webpack-dev-server.html) for loading and running in-browser [Jasmine](http://jasmine.github.io) tests.\n\nIt generates an `spec-runner.html` webpack entry for each of your JavaScript spec-files, specified by a pattern. It uses [sourcemapped-stacktrace](https://github.com/novocaine/sourcemapped-stacktrace) to fix stack traces in the Jasmine HTML reporter so that reported bundle locations (file, line, column) are replaced with their actual source location.\n\n\n## Installation\n\nFirst make sure that `webpack` and `webpack-dev-server` are installed and configured for your project.\nMake sure that Jasmine 2 is installed in your project, and that your spec-tests use the Jasmine APIs (`describe`, `beforeEach`, etc.) as global functions.\n\n```console\nnpm install --save-dev webpack-jasmine-html-runner-plugin\n```\n\n\n## Usage\n\nCreate a webpack configuration for your tests, e.g. `webpack.spec.config.js`:\n\n```js\nconst webpack = require( 'webpack' );\nconst WebpackJasmineHtmlRunnerPlugin = require(\n   'webpack-jasmine-html-runner-plugin'\n);\n\n// Alternatively, `require` your base `webpack.config.js`\n// to add your custom loaders, modules, etc.\nconst config = {};\n\n// In this example, your spec-runners are named\n// e.g. 'lib/some-module/spec/spec-runner.js'.\n// Pass more string arguments to process additional files.\nconfig.entry = WebpackJasmineHtmlRunnerPlugin.entry(\n   './lib/**/spec/spec-runner.js'\n);\nconfig.output = {\n   path: './spec-output',\n   publicPath: '/spec-output/',\n   filename: '[name].bundle.js'\n};\n\nconfig.plugins = [\n   new webpack.SourceMapDevToolPlugin( {\n      filename: '[name].bundle.js.map'\n   } ),\n   new WebpackJasmineHtmlRunnerPlugin( {\n      fixupScripts: []\n   } )\n];\n\nmodule.exports = config;\n```\n\nNow, run webpack and the webpack-dev-server:\n\n```console\nwebpack --config webpack.spec.config.js\nwebpack-dev-server --inline --config webpack.spec.config.js\n```\n\nYou may skip the first step (running `webpack`), but doing so allows you to conveniently browse through a file listing in your web browser, in order to navigate to your spec-tests.\n\nWhen the webpack dev server has finished setting up, you can visit your spec-tests under [localhost:8080/webpack-dev-server/spec-output/](http://localhost:8080/webpack-dev-server/spec-output/) (append `lib/some-module/spec/spec-runner.html` to view the test for `some-module` from above).\n\n\n## Options\n\nThere are some options to customize the behavior of the plugins. You can pass them as an object argument to the plugin constructor.\n\n\n### `includePaths` (default: `[]`)\n\n#### Loading user-defined additional scripts\n\nLet's assume that your project or its tests need additional polyfills or framework scripts to be loaded.\nYou could try to shoehorn those scripts into the webpack entry points generated above, but the `WebpackJasmineHtmlRunnerPlugin` also provides the convenient option `includePaths` for this:\n\nCreate a file containing your additional dependencies, e.g. `polyfills.js`, and modify your configuration like this:\n\n```js\nconst config = require( /* see above */ );\nconfig.entry = WebpackJasmineHtmlRunnerPlugin.entry( /* see above */ );\nconfig.output = { /* see above */ };\n\n// add a webpack entry to also generate the polyfills bundle\nconfig.entry.polyfills = './polyfills.js';\n\nconfig.plugins = [\n   new webpack.SourceMapDevToolPlugin( {\n      filename: '[name].bundle.js.map'\n   } ),\n   new WebpackJasmineHtmlRunnerPlugin( {\n      // add an include path to load the polyfills\n      includePaths: [ path.resolve( process.cwd(), 'spec-output/polyfills.bundle.js' ) ]\n   } )\n];\n\nmodule.exports = config;\n```\n\n\n### `pattern` (default: `/.*\\bspec\\b.*/i`)\n\n#### Filtering spec runners\n\nWhen adding webpack entry points for polyfills and other script-loaded dependencies, you do not want to create HTML spec runners for them.\nHTML will only be generated for entry paths matching this pattern.\nIf your tests follow a different naming conventions, you may need to change this.\n\n\n### `fixupScripts` (default: `[ 'fixup-stacktraces', 'fixup-json-messages' ]`)\n\n#### Loading pre-bundled fixup scripts\n\nTo improve debugging convenience, the plugin comes with several *fixup scripts* that augment the Jasmine 2 HTML reporter.\nThey can be controlled using the option `fixupScripts`, which takes an array of strings:\n\n* `fixup-stacktraces`: uses [sourcemapped-stacktrace](https://github.com/novocaine/sourcemapped-stacktrace) to improve Jasmine stacktraces by looking them up against a source map (if available).\n\n* `fixup-json-messages`: improves formatting of Jasmine error reports when using `expect( objectA ).toEqual( objectB )`.\n  The builtin error messages are relatively hard to read. When using this script, the JSON objects are reformatted, and you can click on them to get a nice colored diff generated by [jsondiffpatch](https://github.com/benjamine/jsondiffpatch).\n","readmeFilename":"README.md"}