@linaj/plugin-karma
Automatic (headless) browser testing with [Karma](https://karma-runner.github.io/latest/index.html).
Last updated a year ago by linaijiao .
Original npm · Tarball · package.json
$ cnpm install @linaj/plugin-karma 
SYNC missed versions from official npm registry.

@linaj/plugin-karma

Automatic (headless) browser testing with Karma.

Introduction

This plugin pre-configures Karma, Jasmine for you so that you can run the tests without any configurations.

Install

yarn add @linaj/plugin-karma --dev

How to use

In your lazy.config.js:

module.exports = {
  plugins: [
    {
      resolve: '@linaj/plugin-karma'
    }
  ]
}

This plugin injected a new command to lazy CLI: lazy test:unit which is a command running in lazy's test mode.

To run it easier, you can configure this in npm scripts:

{
  "name": "my-project",
  "scripts": {
    "test": "lazy test:unit",
    "build": "lazy --prod",
    "start": "lazy --serve"
  },
  "devDependencies": {
    "lazy": "^12.0.0"
  }
}

Now you can run npm test instead.

Test File Patterns

By default this plugin use **/*.{test,spec}.{js,ts} (excluded node_modules) as test files, you can change this to any minimatch pattern (note the quotes to avoid shell expansion):

lazy test:unit "**/*.spec.coffee"

Coverage Report

Use --coverage flag to show code coverage and generate coverage report to ./coverage folder.

Watching Files

Use --watch flag to watch test files.

Running on CI

To run your tests in Continuous Integration Platforms like CircleCI, you will need Chrome installed in your test environment.

Current Tags

  • 0.1.0                                ...           latest (a year ago)

1 Versions

  • 0.1.0                                ...           a year ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 1
Last Month 1
Dependencies (8)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |