Back to rankings

developit/karmatic

JavaScriptnpm.im/karmatic

🦑 Easy automatic (headless) browser testing with Jest's API, but powered by Karma & Webpack.

testingtest-runnerkarmakarma-pluginkarma-webpackjasminechrome-headlessjest
Star Growth
Stars
1.2k
Forks
42
Weekly Growth
Issues
5
9001k1.1k
Jan 2018Nov 2020Sep 2023Jul 2026
Artifactsnpmnpm install karmatic
README

Karmatic npm travis

Zero-config browser tests powered by Karma & Puppeteer, with automatic Rollup & Webpack support.

Think of it like Jest for cross-browser testing - it even uses the same expect syntax.

Why do I want this?

Karma, 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.

Karmatic is a zero-configuration wrapper around these tools with intelligent defaults, configuration auto-detection, and optimizations most configurations don't include.

Most importantly, Karmatic provides a (headless) browser test harness in a single dependency.

Installation

npm i -D karmatic

... then add a test script to your package.json:

{
    "scripts": {
    	"test": "karmatic"
    }
}

... now you can run your tests using npm t. Here's a minimal example repo.

If 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.

Test File Patterns

By default, Karmatic will find tests in any files ending in .test.js or _test.js. You can change this to any minimatch pattern (note the quotes to avoid shell expansion):

karmatic '**/*Spec.jsx?'

Options

--chromeDataDir <filename>

Filename to be used to save Chrome preferences between test runs. Useful for debugging tests. It is recommended to also add this filename to .gitignore.

Example:

karmatic --chromeDataDir .chrome

Usage

Usage
    $ karmatic <command> [options]

Available Commands
    run      Run tests once and exit
    watch    Run tests on any change
    debug    Open a headful Puppeteer instance for debugging your tests

For more info, run any command with the `--help` flag
    $ karmatic run --help
    $ karmatic watch --help

Options
    -v, --version    Displays current version
    --files          Minimatch pattern for test files
    --headless       Run using Chrome Headless  (default true)
    --coverage       Report code coverage of tests  (default true)
    -h, --help       Displays this message

To disable any option that defaults to true, pass false to the option: --headless false or --coverage false.

NOTE: 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.

FAQ

Q: Is there an FAQ?**

Yes.

Projects Using Karmatic

Karmatic is pretty new! Here are some projects that have switched to it you may use as a reference:

License

MIT © developit

Related repositories
goldbergyoni/nodebestpractices

✅ The Node.js best practices list (July 2026)

DockerfileCreative Commons Attribution Share Alike 4.0 Internationalnodejsjavascript
twitter.com/nodepractices/
105.4k10.7k
puppeteer/puppeteer

JavaScript API for Chrome and Firefox

TypeScriptnpmApache License 2.0headless-chrometesting
pptr.dev
95.3k9.5k
microsoft/playwright

Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.

TypeScriptnpmApache License 2.0playwrighttesting
playwright.dev
93.2k6.1k
storybookjs/storybook

Storybook is the industry standard workshop for building, documenting, and testing UI components in isolation

TypeScriptnpmMIT Licensestorybookstyleguide
storybook.js.org
90.6k10.2k
hoppscotch/hoppscotch

Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia

TypeScriptnpmMIT Licenseapiapi-client
hoppscotch.io
79.8k6k
localstack/localstack

💻 A fully functional local AWS cloud stack. Develop and test your cloud & Serverless apps offline

PythonPyPIOtherawslocalstack
localstack.cloud
65.1k4.8k
usebruno/bruno

Opensource IDE For Exploring and Testing API's (lightweight alternative to Postman/Insomnia)

JavaScriptnpmMIT Licenseapi-clientgit
usebruno.com
45.8k2.7k
jestjs/jest

Delightful JavaScript Testing.

TypeScriptnpmMIT Licensejavascripttesting
jestjs.io
45.5k6.7k
stretchr/testify

A toolkit with common assertions and mocks that plays nicely with the standard library

GoGo ModulesMIT Licensetestifygo
pkg.go.dev/github.com/stretchr/testify
26.1k1.8k
goldbergyoni/javascript-testing-best-practices

📗🌐 🚢 Comprehensive and exhaustive JavaScript & Node.js testing best practices (August 2025)

JavaScriptnpmMIT Licensenodejstesting
testjavascript.com
24.6k2.1k
quii/learn-go-with-tests

Learn Go with test-driven development

GoGo ModulesMIT Licensetddgolang
23.8k2.9k
promptfoo/promptfoo

Test your prompts, agents, and RAGs. Red teaming/pentesting/vulnerability scanning for AI. Compare performance of GPT, Claude, Gemini, DeepSeek, and more. Simple declarative configs with command line and CI/CD integration. Used by OpenAI and Anthropic.

TypeScriptnpmMIT Licensellmprompt-engineering
promptfoo.dev
23.5k2.1k