{"id":13451888,"url":"https://github.com/developit/karmatic","last_synced_at":"2025-04-14T11:23:02.800Z","repository":{"id":57288616,"uuid":"118652595","full_name":"developit/karmatic","owner":"developit","description":"🦑 Easy automatic (headless) browser testing with Jest's API, but powered by Karma \u0026 Webpack.","archived":false,"fork":false,"pushed_at":"2022-05-23T20:29:48.000Z","size":152,"stargazers_count":1172,"open_issues_count":10,"forks_count":42,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-04-07T02:19:38.552Z","etag":null,"topics":["chrome-headless","jasmine","jest","karma","karma-plugin","karma-webpack","test-runner","testing"],"latest_commit_sha":null,"homepage":"https://npm.im/karmatic","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-23T18:38:09.000Z","updated_at":"2025-03-14T16:32:21.000Z","dependencies_parsed_at":"2022-09-20T04:51:59.717Z","dependency_job_id":null,"html_url":"https://github.com/developit/karmatic","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fkarmatic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fkarmatic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fkarmatic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developit%2Fkarmatic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developit","download_url":"https://codeload.github.com/developit/karmatic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248869253,"owners_count":21174842,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chrome-headless","jasmine","jest","karma","karma-plugin","karma-webpack","test-runner","testing"],"created_at":"2024-07-31T07:01:05.968Z","updated_at":"2025-04-14T11:23:02.768Z","avatar_url":"https://github.com/developit.png","language":"JavaScript","readme":"# Karmatic [![npm](https://img.shields.io/npm/v/karmatic.svg)](https://npm.im/karmatic) [![travis](https://travis-ci.org/developit/karmatic.svg?branch=master)](https://travis-ci.org/developit/karmatic)\n\nZero-config browser tests powered by [Karma] \u0026 [Puppeteer], with automatic [Rollup] \u0026 [Webpack] support.\n\nThink of it like **Jest for cross-browser testing** - it even uses the same [expect syntax](https://jestjs.io/docs/en/using-matchers).\n\n## Why do I want this?\n\nKarma, Rollup/Webpack and Jasmine are all great. They're all also quite powerful and each highly configurable. When creating and maintaining small modules, duplication of these configurations and dependencies is cumbersome.\n\nKarmatic is a zero-configuration wrapper around these tools with intelligent defaults, configuration auto-detection, and optimizations most configurations don't include.\n\nMost importantly, Karmatic provides a (headless) browser test harness in a single dependency.\n\n## Installation\n\n```sh\nnpm i -D karmatic\n```\n\n... then add a `test` script to your `package.json`:\n\n```js\n{\n    \"scripts\": {\n    \t\"test\": \"karmatic\"\n    }\n}\n```\n\n... now you can run your tests using `npm t`. Here's a [minimal example repo](https://gist.github.com/developit/acd8a075350eeb6574439e92888c50cf).\n\nIf you have webpack set up in your project, it will be detected and your `webpack.config.js` will be used. Otherwise, Rollup is used to bundle tests and any `rollup.config.js` will be used if present.\n\n### Test File Patterns\n\nBy default, Karmatic will find tests in any files ending in `.test.js` or `_test.js`.\nYou can change this to any minimatch pattern _(note the quotes to avoid shell expansion)_:\n\n```sh\nkarmatic '**/*Spec.jsx?'\n```\n\n### Options\n\n`--chromeDataDir \u003cfilename\u003e`\n\nFilename to be used to save Chrome preferences between test runs. Useful for debugging tests. It is recommended to also add this filename to `.gitignore`.\n\nExample:\n\n```\nkarmatic --chromeDataDir .chrome\n```\n\n## Usage\n\n```text\nUsage\n    $ karmatic \u003ccommand\u003e [options]\n\nAvailable Commands\n    run      Run tests once and exit\n    watch    Run tests on any change\n    debug    Open a headful Puppeteer instance for debugging your tests\n\nFor more info, run any command with the `--help` flag\n    $ karmatic run --help\n    $ karmatic watch --help\n\nOptions\n    -v, --version    Displays current version\n    --files          Minimatch pattern for test files\n    --headless       Run using Chrome Headless  (default true)\n    --coverage       Report code coverage of tests  (default true)\n    -h, --help       Displays this message\n```\n\nTo disable any option that defaults to `true`, pass `false` to the option: `--headless false` or `--coverage false`.\n\nNOTE: The `debug` option overrides the default value of the `--headless` and `--coverage` option to be `false`. This option will also open up the local Puppeteer installation of Chrome, not your globally installed one. If you'd like to debug your tests using your your own instance of Chrome (or any other browser), copy the URL from the puppeteer window into your favorite browser.\n\n## FAQ\n\n**Q**: [Is there an FAQ?](https://twitter.com/gauntface/status/956259291928776704)\\*\\*\n\n\u003e Yes.\n\n## Projects Using Karmatic\n\nKarmatic is pretty new! Here are some projects that have switched to it you may use as a reference:\n\n- [workerize-loader](https://github.com/developit/workerize-loader/commit/afaa20bbfbdec1d6a5523ec69ba2a2d5d495cfd6)\n\n## License\n\n[MIT](https://oss.ninja/mit/developit) © [developit](https://github.com/developit)\n\n[karma]: https://karma-runner.github.io\n[rollup]: https://rollupjs.org/\n[webpack]: https://webpack.js.org\n[jasmine]: https://jasmine.github.io\n[puppeteer]: https://github.com/GoogleChrome/puppeteer\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopit%2Fkarmatic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevelopit%2Fkarmatic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevelopit%2Fkarmatic/lists"}