karmatic
Zero-config automatic (headless) browser testing. Powered by Karma, Webpack & Jasmine.
Last updated 2 months ago by developit .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install karmatic 
SYNC missed versions from official npm registry.

Karmatic npm travis

A simplified zero-configuration wrapper around Karma, Webpack, Jasmine & Puppeteer.

Why do I want this?

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

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?'

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

Current Tags

  • 1.4.0                                ...           latest (2 months ago)

13 Versions

  • 1.4.0                                ...           2 months ago
  • 1.3.1                                ...           7 months ago
  • 1.3.0                                ...           7 months ago
  • 1.2.0                                ...           a year ago
  • 1.1.7                                ...           a year ago
  • 1.0.7                                ...           a year ago
  • 1.0.6                                ...           2 years ago
  • 1.0.5                                ...           2 years ago
  • 1.0.4                                ...           2 years ago
  • 1.0.3                                ...           2 years ago
  • 1.0.2                                ...           2 years ago
  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 54
Last Day 0
Last Week 54
Last Month 4
Dev Dependencies (5)
Dependents (1)

Copyright 2014 - 2016 © taobao.org |