@pigs/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 @pigs/plugin-karma 
SYNC missed versions from official npm registry.

@pigs/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 @pigs/plugin-karma --dev

How to use

In your pigs.config.js:

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

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

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

{
  "name": "my-project",
  "scripts": {
    "test": "pigs test:unit",
    "build": "pigs --prod",
    "start": "pigs --serve"
  },
  "devDependencies": {
    "pigs": "^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):

pigs 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

  • 13.0.2                                ...           latest (a year ago)

1 Versions

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

Copyright 2014 - 2016 © taobao.org |