包详细信息

@open-wc/testing-karma

open-wc16.8kMIT4.0.9

Testing with karma following open-wc recommendations

testing, karma, mocha, compatibility

自述文件


permalink: 'testing/testing-karma.html' title: Testing with Karma section: guides tags:

- guides

Notice

We have stopped new development of this package.

We will continue to support security patches and bug fixes, but we recommend web test runner for testing web component projects.

Testing with Karma

Configuration for setting up testing with karma.

We recommend karma as a general-purpose tool for testing code that runs in the browser. Karma can run a large range of browsers, including IE11. This way you are confident that your code runs correctly in all supported environments.

During development you can run Chrome Headless, giving fast feedback in the terminal while writing your tests. In your CI you can run more browsers, and/or use a service like Browserstack or Saucelabs for testing in all supported browsers.

Karma can be used both for running unit tests, as well as for running more complex e2e/integration tests in the DOM.

Getting started

Our configuration sets up karma to run tests based on es modules with the necessary polyfills and fallbacks for older browsers and convenient test reporting.

This page explains how to set up karma, see the testing overview for guides and libraries to get started with testing in general.

Features

  • Runs tests with es modules
  • Serves static files
  • Runs tests through mocha
  • Deep object diffs in mocha errors
  • Test coverage through instanbul when passing the coverage flag
  • Supports older browsers (down to IE11)

Setup

With our project scaffolding you can set up a pre-configured project, or you can upgrade an existing project by choosing Upgrade -> Testing:

npm init @open-wc

Manual

Install:

npm i -D @open-wc/testing-karma deepmerge karma

Create a karma.conf.js:

const { createDefaultConfig } = require('@open-wc/testing-karma');
const merge = require('deepmerge');

module.exports = config => {
  config.set(
    merge(createDefaultConfig(config), {
      files: [
        // runs all files ending with .test in the test folder,
        // can be overwritten by passing a --grep flag. examples:
        //
        // npm run test -- --grep test/foo/bar.test.js
        // npm run test -- --grep test/bar/*
        { pattern: config.grep ? config.grep : 'test/**/*.test.js', type: 'module' },
      ],

      // see the karma-esm docs for all options
      esm: {
        // if you are using 'bare module imports' you will need this option
        nodeResolve: true,
      },
    }),
  );
  return config;
};

Add scripts to your package.json:

{
  "scripts": {
    "test": "karma start --coverage",
    "test:watch": "karma start --auto-watch=true --single-run=false",
    "test:update-snapshots": "karma start --update-snapshots",
    "test:prune-snapshots": "karma start --prune-snapshots"
  }
}

Workflow

Commands explained:

  • test: does a single test run on the configured browsers (default headless chrome) and prints tests and coverage results.
  • test:watch: does a single test run, and then re-runs on file changes. coverage is not analyzed for performance. in watch mode you can also visit http://localhost:9876/debug.html to debug in the browser
  • test:update-snapshots: updates any snapshots files from @open-wc/semantic-dom-diff. Use this when your component's rendered HTML changed.
  • test:prune-snapshots: prunes any used snapshots files from @open-wc/semantic-dom-diff.

Testing single files or folders

By default, karma runs all your test files. To test a single file or folder, use the --grep flag. (If you did a manual setup, makes sure your config handles this flag).

Pass which files to test to the grep flag: npm run test -- --grep test/foo/bar.test.js.

Debugging in the browser

While testing, it can be useful to debug your tests in a real browser so that you can use the browser's dev tools.

Use npm run test:watch to keep karma running. Then open the URL printed by karma when it boots up. By default, this is http://localhost:9876/. Click the debug button in the top right corner, or go directly to http://localhost:9876/debug.html.

You can bookmark this page for easy access.

Adding debugger statements will allow you to debug using the browser's dev tools.

Testing on older browsers

Testing on older browsers is powered by es-dev-server's compatibility mode.

See the compatibility documentation of es-dev-server for more information.

Testing on WSL (Windows Subsystem for Linux)

Currently Chrome Headless has issues on WSL. Until they are fixed, you can work around it by pointing your CHROME_BIN variable to your Windows installation of chrome instead of chromium inside your linux distro. This works because with WSL, you can use executables between environments.

export CHROME_BIN=/mnt/c/Program\ Files\ \(x86\)/Google/Chrome/Application/chrome.exe

Why don't you recommend testing tool X?

Sometimes people ask why we recommend Karma and not other popular testing tools. We're always on the lookout for improving our recommendations, so if you think we can do better please let us know. What's important for us is that the testing tool is robust, simple to use, does not require any building, and runs in a real browser.

Testing tools that don't use a real browser but something like JSDOM constantly need to keep up with the latest browser standards, so you need to wait for your testing tool to update before you can use a new feature. It doesn't give the same confidence as testing in a real browser, and with Headless Chrome and Puppeteer it hardly seems necessary anymore.

Extending the config

To extend the karma config, we recommend using deepmerge. This will do smart merging of complex objects. You can extend any of the configuration. For example to set your own test coverage threshold:

const { createDefaultConfig } = require('@open-wc/testing-karma');
const merge = require('deepmerge');

module.exports = config => {
  config.set(
    deepmerge(createDefaultConfig(config), {
      files: [
        // runs all files ending with .test in the test folder,
        // can be overwritten by passing a --grep flag. examples:
        //
        // npm run test -- --grep test/foo/bar.test.js
        // npm run test -- --grep test/bar/*
        { pattern: config.grep ? config.grep : 'test/**/*.test.js', type: 'module' },
      ],

      coverageReporter: {
        check: {
          global: {
            statements: 50,
            lines: 50,
            branches: 50,
            functions: 50,
          },
        },
      },
    }),
  );
  return config;
};

Custom babel plugins

karma-esm supports custom babel configurations. Check out the documentaton for more information.

Typescript

Because karma-esm doesn't do any bundling, it is compatible with typescript out of the box. Check out the documentaton for more information.

Testing in a monorepository

When testing without a bundler you will be serving every imported module straight from the file system. Karma cannot serve files outside the path of the webserver, which by default starts from the directory of your karma config.

In a monorepo dependencies are often two levels higher in the root of the repository. To run tests in a monorepository you either have to put your config in the root of the repository, or adjust the basePath in your karma config:

const { createDefaultConfig } = require('@open-wc/testing-karma');
const merge = require('deepmerge');

module.exports = config => {
  config.set(
    merge(createDefaultConfig(config), {
      files: [{ pattern: config.grep ? config.grep : 'test/**/*.test.js', type: 'module' }],

      basePath: '../../',
    }),
  );
  return config;
};

Preserving symlinks

When using a tool that relies on symlinks such as npm link or lerna, the es-dev-server that runs under the hood of karma-esm plugin needs to run with --preserve-symlinks option.

You can pass this option via the esm plugin configuration:

  ...
  esm: {
    nodeResolve: true,
    preserveSymlinks: true,
  },
  ...

Check out the documentaton for more information.

Other configuration

karma-esm is the plugin powering our configuration, and it supports a few more for advanced use cases. Check out the documentaton for more information.

const { createDefaultConfig } = require('@open-wc/testing-karma');
const merge = require('deepmerge');

module.exports = config => {
  config.set(
    merge(createDefaultConfig(config), {
      files: [{ pattern: config.grep ? config.grep : 'test/**/*.test.js', type: 'module' }],

      basePath: '../../',
    }),
  );
  return config;
};

更新日志

Change Log

All notable changes to this project will be documented in this file. See Conventional Commits for commit guidelines.

4.0.9 (2020-10-11)

Note: Version bump only for package @open-wc/testing-karma

4.0.8 (2020-10-03)

Note: Version bump only for package @open-wc/testing-karma

4.0.7 (2020-10-01)

Note: Version bump only for package @open-wc/testing-karma

4.0.6 (2020-09-25)

Note: Version bump only for package @open-wc/testing-karma

4.0.5 (2020-08-27)

Note: Version bump only for package @open-wc/testing-karma

4.0.4 (2020-08-19)

Note: Version bump only for package @open-wc/testing-karma

4.0.3 (2020-08-10)

Note: Version bump only for package @open-wc/testing-karma

4.0.2 (2020-08-04)

Note: Version bump only for package @open-wc/testing-karma

4.0.1 (2020-07-29)

Note: Version bump only for package @open-wc/testing-karma

4.0.0 (2020-07-24)

Features

  • testing-karma: use up to date coverage reporter (e853364), closes #1164

BREAKING CHANGES

  • testing-karma: coverageIstanbulReporter object in karma config has been replaced with coverageReporter move from karma-coverage-istanbul-reporter to karma-coverage

See MIGRATION.md for more info.

3.4.8 (2020-07-24)

Note: Version bump only for package @open-wc/testing-karma

3.4.7 (2020-07-10)

Note: Version bump only for package @open-wc/testing-karma

3.4.6 (2020-06-25)

Note: Version bump only for package @open-wc/testing-karma

3.4.5 (2020-06-22)

Note: Version bump only for package @open-wc/testing-karma

3.4.4 (2020-06-12)

Bug Fixes

  • testing-karma: disable restartOnFileChange option (096452c)

3.4.3 (2020-06-11)

Note: Version bump only for package @open-wc/testing-karma

3.4.2 (2020-06-05)

Note: Version bump only for package @open-wc/testing-karma

3.4.1 (2020-05-29)

Note: Version bump only for package @open-wc/testing-karma

3.4.0 (2020-05-25)

Features

  • chai-a11y-axe: lazy load axe when needed (3001381)

3.3.32 (2020-05-24)

Note: Version bump only for package @open-wc/testing-karma

3.3.31 (2020-05-24)

Note: Version bump only for package @open-wc/testing-karma

3.3.30 (2020-05-22)

Note: Version bump only for package @open-wc/testing-karma

3.3.29 (2020-05-21)

Note: Version bump only for package @open-wc/testing-karma

3.3.28 (2020-05-17)

Note: Version bump only for package @open-wc/testing-karma

3.3.27 (2020-05-16)

Note: Version bump only for package @open-wc/testing-karma

3.3.26 (2020-05-16)

Note: Version bump only for package @open-wc/testing-karma

3.3.25 (2020-05-15)

Note: Version bump only for package @open-wc/testing-karma

3.3.24 (2020-05-15)

Note: Version bump only for package @open-wc/testing-karma

3.3.23 (2020-05-14)

Note: Version bump only for package @open-wc/testing-karma

3.3.22 (2020-05-14)

Note: Version bump only for package @open-wc/testing-karma

3.3.21 (2020-05-14)

Note: Version bump only for package @open-wc/testing-karma

3.3.20 (2020-05-13)

Note: Version bump only for package @open-wc/testing-karma

3.3.19 (2020-05-05)

Note: Version bump only for package @open-wc/testing-karma

3.3.18 (2020-05-05)

Note: Version bump only for package @open-wc/testing-karma

3.3.17 (2020-04-26)

Bug Fixes

  • karma-esm: fix polyfills-loader types (e301a94)
  • testing-karma: export types (753c359)

3.3.16 (2020-04-26)

Note: Version bump only for package @open-wc/testing-karma

3.3.15 (2020-04-21)

Note: Version bump only for package @open-wc/testing-karma

3.3.14 (2020-04-20)

Note: Version bump only for package @open-wc/testing-karma

3.3.12 (2020-04-12)

Note: Version bump only for package @open-wc/testing-karma

3.3.11 (2020-04-05)

Note: Version bump only for package @open-wc/testing-karma

3.3.10 (2020-03-26)

Note: Version bump only for package @open-wc/testing-karma

3.3.9 (2020-03-24)

Note: Version bump only for package @open-wc/testing-karma

3.3.8 (2020-03-19)

Note: Version bump only for package @open-wc/testing-karma

3.3.7 (2020-03-15)

Note: Version bump only for package @open-wc/testing-karma

3.3.6 (2020-03-15)

Note: Version bump only for package @open-wc/testing-karma

3.3.5 (2020-03-11)

Note: Version bump only for package @open-wc/testing-karma

3.3.4 (2020-03-10)

Note: Version bump only for package @open-wc/testing-karma

3.3.3 (2020-03-08)

Note: Version bump only for package @open-wc/testing-karma

3.3.2 (2020-03-06)

Note: Version bump only for package @open-wc/testing-karma

3.3.1 (2020-03-02)

Note: Version bump only for package @open-wc/testing-karma

3.3.0 (2020-02-29)

Features

  • rollup-plugin-html: first release (9acb29a)

3.2.43 (2020-02-23)

Note: Version bump only for package @open-wc/testing-karma

3.2.42 (2020-02-10)

Note: Version bump only for package @open-wc/testing-karma

3.2.41 (2020-02-10)

Note: Version bump only for package @open-wc/testing-karma

3.2.40 (2020-02-09)

Note: Version bump only for package @open-wc/testing-karma

3.2.39 (2020-02-09)

Note: Version bump only for package @open-wc/testing-karma

3.2.38 (2020-02-06)

Note: Version bump only for package @open-wc/testing-karma

3.2.37 (2020-02-03)

Note: Version bump only for package @open-wc/testing-karma

3.2.36 (2020-02-03)

Note: Version bump only for package @open-wc/testing-karma

3.2.35 (2020-02-02)

Note: Version bump only for package @open-wc/testing-karma

3.2.34 (2020-02-02)

Note: Version bump only for package @open-wc/testing-karma

3.2.33 (2020-01-31)

Note: Version bump only for package @open-wc/testing-karma

3.2.32 (2020-01-27)

Note: Version bump only for package @open-wc/testing-karma

3.2.31 (2020-01-27)

Note: Version bump only for package @open-wc/testing-karma

3.2.30 (2020-01-13)

Bug Fixes

  • testing-karma: latest karma-chrome-launcher decreases memory use (707beba)

3.2.29 (2020-01-13)

Note: Version bump only for package @open-wc/testing-karma

3.2.28 (2020-01-07)

Note: Version bump only for package @open-wc/testing-karma

3.2.27 (2020-01-07)

Bug Fixes

  • testing-karma: use an os-agnostic pathResolver (e3ad027)
  • remove unused path (3f80674)

3.2.26 (2020-01-06)

Note: Version bump only for package @open-wc/testing-karma

3.2.25 (2020-01-03)

Note: Version bump only for package @open-wc/testing-karma

3.2.24 (2019-12-30)

Note: Version bump only for package @open-wc/testing-karma

3.2.23 (2019-12-30)

Note: Version bump only for package @open-wc/testing-karma

3.2.22 (2019-12-30)

Note: Version bump only for package @open-wc/testing-karma

3.2.21 (2019-12-20)

Bug Fixes

  • testing-karma: removes snapshot filename processor (8fe192a)

3.2.20 (2019-12-18)

Note: Version bump only for package @open-wc/testing-karma

3.2.19 (2019-12-16)

Note: Version bump only for package @open-wc/testing-karma

3.2.18 (2019-12-16)

Note: Version bump only for package @open-wc/testing-karma

3.2.17 (2019-12-15)

Note: Version bump only for package @open-wc/testing-karma

3.2.16 (2019-12-11)

Note: Version bump only for package @open-wc/testing-karma

3.2.15 (2019-12-09)

Note: Version bump only for package @open-wc/testing-karma

3.2.14 (2019-12-09)

Note: Version bump only for package @open-wc/testing-karma

3.2.13 (2019-12-08)

Note: Version bump only for package @open-wc/testing-karma

3.2.12 (2019-12-08)

Note: Version bump only for package @open-wc/testing-karma

3.2.11 (2019-12-05)

Note: Version bump only for package @open-wc/testing-karma

3.2.10 (2019-12-05)

Note: Version bump only for package @open-wc/testing-karma

3.2.9 (2019-12-02)

Note: Version bump only for package @open-wc/testing-karma

3.2.8 (2019-12-01)

Note: Version bump only for package @open-wc/testing-karma

3.2.7 (2019-11-30)

Note: Version bump only for package @open-wc/testing-karma

3.2.6 (2019-11-27)

Note: Version bump only for package @open-wc/testing-karma

3.2.5 (2019-11-24)

Note: Version bump only for package @open-wc/testing-karma

3.2.4 (2019-11-21)

Note: Version bump only for package @open-wc/testing-karma

3.2.3 (2019-11-20)

Note: Version bump only for package @open-wc/testing-karma

3.2.2 (2019-11-20)

Note: Version bump only for package @open-wc/testing-karma

3.2.1 (2019-11-19)

Note: Version bump only for package @open-wc/testing-karma

3.2.0 (2019-11-19)

Bug Fixes

  • use es-dev-server auto compatibility (df6fe21)

Features

  • update testing to use auto compatibility of es-dev-server (7d5ea56)

3.1.54 (2019-11-07)

Note: Version bump only for package @open-wc/testing-karma

3.1.53 (2019-11-06)

Note: Version bump only for package @open-wc/testing-karma

3.1.52 (2019-11-04)

Note: Version bump only for package @open-wc/testing-karma

3.1.51 (2019-11-03)

Bug Fixes

  • align versions within the monorepo (fa2ad9f)

3.1.50 (2019-11-02)

Note: Version bump only for package @open-wc/testing-karma

3.1.49 (2019-11-02)

Note: Version bump only for package @open-wc/testing-karma

3.1.48 (2019-10-31)

Note: Version bump only for package @open-wc/testing-karma

3.1.47 (2019-10-30)

Note: Version bump only for package @open-wc/testing-karma

3.1.46 (2019-10-26)

Note: Version bump only for package @open-wc/testing-karma

3.1.45 (2019-10-26)

Note: Version bump only for package @open-wc/testing-karma

3.1.44 (2019-10-26)

Note: Version bump only for package @open-wc/testing-karma

3.1.43 (2019-10-25)

Bug Fixes

3.1.42 (2019-10-23)

Bug Fixes

3.1.41 (2019-10-22)

Note: Version bump only for package @open-wc/testing-karma

3.1.40 (2019-10-15)

Note: Version bump only for package @open-wc/testing-karma

3.1.39 (2019-10-13)

Note: Version bump only for package @open-wc/testing-karma

3.1.38 (2019-09-27)

Note: Version bump only for package @open-wc/testing-karma

3.1.37 (2019-09-27)

Note: Version bump only for package @open-wc/testing-karma

3.1.36 (2019-09-27)

Note: Version bump only for package @open-wc/testing-karma

3.1.35 (2019-09-27)

Note: Version bump only for package @open-wc/testing-karma

3.1.34 (2019-09-22)

Note: Version bump only for package @open-wc/testing-karma

3.1.33 (2019-09-11)

Note: Version bump only for package @open-wc/testing-karma

3.1.32 (2019-09-04)

Note: Version bump only for package @open-wc/testing-karma

3.1.31 (2019-08-29)

Note: Version bump only for package @open-wc/testing-karma

3.1.30 (2019-08-28)

Note: Version bump only for package @open-wc/testing-karma

3.1.29 (2019-08-27)

Note: Version bump only for package @open-wc/testing-karma

3.1.28 (2019-08-26)

Note: Version bump only for package @open-wc/testing-karma

3.1.27 (2019-08-26)

Note: Version bump only for package @open-wc/testing-karma

3.1.26 (2019-08-25)

Note: Version bump only for package @open-wc/testing-karma

3.1.25 (2019-08-25)

Note: Version bump only for package @open-wc/testing-karma

3.1.24 (2019-08-22)

Note: Version bump only for package @open-wc/testing-karma

3.1.23 (2019-08-21)

Note: Version bump only for package @open-wc/testing-karma

3.1.22 (2019-08-20)

Note: Version bump only for package @open-wc/testing-karma

3.1.21 (2019-08-20)

Bug Fixes

  • do not destructure exports to support es-module-lexer (3709413)

3.1.20 (2019-08-18)

Bug Fixes

  • use chai instead of @bundled-es-modules/chai (f9d19bb)

3.1.19 (2019-08-17)

Note: Version bump only for package @open-wc/testing-karma

3.1.18 (2019-08-14)

Note: Version bump only for package @open-wc/testing-karma

3.1.17 (2019-08-13)

Note: Version bump only for package @open-wc/testing-karma

3.1.16 (2019-08-13)

Note: Version bump only for package @open-wc/testing-karma

3.1.15 (2019-08-12)

Note: Version bump only for package @open-wc/testing-karma

3.1.14 (2019-08-12)

Note: Version bump only for package @open-wc/testing-karma

3.1.13 (2019-08-07)

Note: Version bump only for package @open-wc/testing-karma

3.1.12 (2019-08-07)

Note: Version bump only for package @open-wc/testing-karma

3.1.11 (2019-08-05)

Bug Fixes

  • cleanup package.json scripts (be6bdb5)

3.1.10 (2019-08-04)

Note: Version bump only for package @open-wc/testing-karma

3.1.9 (2019-08-04)

Note: Version bump only for package @open-wc/testing-karma

3.1.8 (2019-08-04)

Note: Version bump only for package @open-wc/testing-karma

3.1.7 (2019-08-04)

Note: Version bump only for package @open-wc/testing-karma

3.1.6 (2019-07-30)

Note: Version bump only for package @open-wc/testing-karma

3.1.5 (2019-07-28)

Note: Version bump only for package @open-wc/testing-karma

3.1.4 (2019-07-26)

Note: Version bump only for package @open-wc/testing-karma

3.1.3 (2019-07-25)

Note: Version bump only for package @open-wc/testing-karma

3.1.2 (2019-07-24)

Note: Version bump only for package @open-wc/testing-karma

3.1.1 (2019-07-24)

Note: Version bump only for package @open-wc/testing-karma

3.1.0 (2019-07-24)

Features

  • testing: adding a11y testing via chai-a11y-axe plugin (5f05b53)

3.0.7 (2019-07-24)

Note: Version bump only for package @open-wc/testing-karma

3.0.6 (2019-07-22)

Note: Version bump only for package @open-wc/testing-karma

3.0.5 (2019-07-22)

Bug Fixes

  • testing-karma: add missing mocha dependency (#607) (7a0f38e)

3.0.4 (2019-07-19)

Note: Version bump only for package @open-wc/testing-karma

3.0.3 (2019-07-17)

Note: Version bump only for package @open-wc/testing-karma

3.0.2 (2019-07-17)

Note: Version bump only for package @open-wc/testing-karma

3.0.1 (2019-07-17)

Note: Version bump only for package @open-wc/testing-karma

3.0.0 (2019-07-15)

Features

  • testing-karma: support modules on all browsers (e800597)

BREAKING CHANGES

  • testing-karma: Removed the legacy flag which used webpack on older browsers. We now use karma-esm everywhere which supports older browsers with a compatibility option.

Update your package.json script:

// before
"test": "karma start --legacy",

// after
"test": "karma start --compatibility all"
  • testing-karma: changed config import path: ```js // before const createDefaultConfig = require('@open-wc/testing-karma/default-config.js');

// after const { createDefaultConfig } = require('@open-wc/testing-karma');

* **testing-karma:** node resolve is no longer enabled by default
You can enable it by adding this to your karma config:

```js
esm: {
  nodeResolve: true
},

2.0.16 (2019-07-13)

Note: Version bump only for package @open-wc/testing-karma

2.0.15 (2019-07-08)

Note: Version bump only for package @open-wc/testing-karma

2.0.14 (2019-07-08)

Bug Fixes

  • use file extensions for imports to support import maps (c711b13)

2.0.13 (2019-07-08)

Note: Version bump only for package @open-wc/testing-karma

2.0.12 (2019-07-08)

Note: Version bump only for package @open-wc/testing-karma

2.0.11 (2019-07-02)

Note: Version bump only for package @open-wc/testing-karma

2.0.10 (2019-07-02)

Note: Version bump only for package @open-wc/testing-karma

2.0.9 (2019-06-30)

Note: Version bump only for package @open-wc/testing-karma

2.0.8 (2019-06-23)

Note: Version bump only for package @open-wc/testing-karma

2.0.7 (2019-06-23)

Note: Version bump only for package @open-wc/testing-karma

2.0.6 (2019-06-18)

Note: Version bump only for package @open-wc/testing-karma

2.0.5 (2019-06-14)

Note: Version bump only for package @open-wc/testing-karma

2.0.4 (2019-06-08)

Bug Fixes

  • testing-karma: changelog formatting for 2.0.0 (a0c70f8)

2.0.3 (2019-05-25)

Note: Version bump only for package @open-wc/testing-karma

2.0.2 (2019-05-19)

Note: Version bump only for package @open-wc/testing-karma

2.0.1 (2019-05-06)

Note: Version bump only for package @open-wc/testing-karma

2.0.0 (2019-05-06)

Features

  • testing-karma: use native es modules in modern browsers (187d155)

BREAKING CHANGES

  • testing-karma: You need to specify type: 'module' for you files ```js // old karma.conf.js files: [ config.grep ? config.grep : 'test/*/.test.js', ]

// new karma.conf.js files: [ { pattern: config.grep ? config.grep : 'test/*/.test.js', type: 'module' }, ]





## [1.1.2](https://github.com/open-wc/open-wc/compare/@open-wc/testing-karma@1.1.1...@open-wc/testing-karma@1.1.2) (2019-05-03)

**Note:** Version bump only for package @open-wc/testing-karma





## [1.1.1](https://github.com/open-wc/open-wc/compare/@open-wc/testing-karma@1.1.0...@open-wc/testing-karma@1.1.1) (2019-04-14)


### Bug Fixes

* update generator usage ([5d284d4](https://github.com/open-wc/open-wc/commit/5d284d4))





# [1.1.0](https://github.com/open-wc/open-wc/compare/@open-wc/testing-karma@1.0.2...@open-wc/testing-karma@1.1.0) (2019-04-08)


### Features

* **semantic-dom-diff:** add support for snapshot testing ([f7a675a](https://github.com/open-wc/open-wc/commit/f7a675a))





## [1.0.2](https://github.com/open-wc/open-wc/compare/@open-wc/testing-karma@1.0.1...@open-wc/testing-karma@1.0.2) (2019-04-06)


### Bug Fixes

* **testing-karma:** resolve chrome launcher ([6e303b5](https://github.com/open-wc/open-wc/commit/6e303b5))





## [1.0.1](https://github.com/open-wc/open-wc/compare/@open-wc/testing-karma@1.0.0...@open-wc/testing-karma@1.0.1) (2019-04-05)


### Bug Fixes

* do not assume available global types of users ([cd394d9](https://github.com/open-wc/open-wc/commit/cd394d9))





# [1.0.0](https://github.com/open-wc/open-wc/compare/@open-wc/testing-karma@0.4.15...@open-wc/testing-karma@1.0.0) (2019-03-31)


### Bug Fixes

* adopt new karma setup for all packages ([1888260](https://github.com/open-wc/open-wc/commit/1888260))


### Features

* **testing-karma:** improve karma config setup ([b173380](https://github.com/open-wc/open-wc/commit/b173380))


### BREAKING CHANGES

* **testing-karma:** overall setup changed
=> if you have mostly default configs you should be able to just run `npm init @open-wc testing`
* **testing-karma:** `karma.conf.js` changes
```js
// old
const defaultSettings = require('@open-wc/testing-karma/default-settings.js');

// new
const createDefaultConfig = require('@open-wc/testing-karma/default-config.js');
  • testing-karma: karma.es5.config.js is no longer needed => use karma start --legacy instead
  • testing-karma: karma.es5.bs.config.js renamed to karma.bs.config.js
  • testing-karma: karma.bs.config.js changes ```js // old const karmaEs5Config = require('./karma.es5.config.js');

// new const createBaseConfig = require('./karma.conf.js');

* **testing-karma:** `package.json` scripts changed
```js
// old package.json
"scripts": {
  "test": "karma start",
  "test:watch": "karma start --auto-watch=true --single-run=false",
  "test:es5": "karma start karma.es5.config.js",
  "test:es5:watch": "karma start karma.es5.config.js --auto-watch=true --single-run=false",
  "test:es5:bs": "karma start karma.es5.bs.config.js"
},

// new
"scripts": {
  "test": "karma start --coverage",
  "test:watch": "karma start --auto-watch=true --single-run=false",
  "test:legacy": "karma start --legacy --coverage",
  "test:legacy:watch": "karma start --legacy --auto-watch=true --single-run=false",
  "test:bs": "karma start karma.bs.conf.js --legacy --coverage"
}

0.4.15 (2019-03-23)

Note: Version bump only for package @open-wc/testing-karma

0.4.14 (2019-03-08)

Bug Fixes

  • testing-karma: exclude spec files in node_modules (c4ad1c1)

0.4.13 (2019-03-03)

Bug Fixes

  • testing-karma: replace deprecated import meta url loader (e44f3ca)

0.4.12 (2019-02-26)

Bug Fixes

  • testing-karma: add docs how to replace a specific config part (7bcb901)

0.4.11 (2019-02-16)

Bug Fixes

  • update package repository fields with monorepo details (cb1acb7)

0.4.10 (2019-02-14)

Bug Fixes

  • testing-karma: upgrade karma to 4.x (7b8a2f2)

0.4.9 (2019-02-02)

Bug Fixes

  • unify npm readme header for all open-wc packages (1bac939)

0.4.8 (2019-02-02)

Bug Fixes

  • testing-karma: show file/line number of failing tests on terminal (32b0b00)

0.4.7 (2019-01-26)

Bug Fixes

  • align all open-wc readme headers (b589429)

0.4.6 (2019-01-20)

Bug Fixes

0.4.5 (2019-01-19)

Bug Fixes

  • restructure menu and improve docu (dd37e22)

0.4.4 (2019-01-16)

Bug Fixes

0.4.3 (2019-01-09)

Bug Fixes

0.4.2 (2018-12-20)

Note: Version bump only for package @open-wc/testing-karma

0.4.1 (2018-12-20)

Bug Fixes

0.4.0 (2018-12-19)

Features

  • use extendable karma configs by default (8fd9435)

0.3.0 (2018-12-13)

Bug Fixes

  • apply prettier; add lint-staged (43acfad)

Features

  • testing-karma: use karma-webpack#^5.0.0 for proper wc support (#89) (10e0de8)

0.2.3 (2018-12-02)

Note: Version bump only for package @open-wc/testing-karma

0.2.2 (2018-12-01)

Note: Version bump only for package @open-wc/testing-karma

0.2.1 (2018-11-30)

Bug Fixes

  • move documentation to READMEs of packages (b4a0426)

0.2.0 (2018-11-26)

Features

  • testing-karma: provide latest and es5 karma config creators (575f53e)

0.1.3 (2018-10-28)

Bug Fixes

0.1.2 (2018-10-27)

Bug Fixes

  • deps: update dependency karma to v3.1.1 (29476bb)
  • deps: update dependency webpack to v4.23.1 (9f0f8bd)

0.1.1 (2018-10-07)

Bug Fixes

  • move karma-bs into its own package (9a15330)

0.1.0 (2018-10-06)

Bug Fixes

Features