min-karma
Minimal Karma Runner setup
Last updated a year ago by dmitriz .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install min-karma 
SYNC missed versions from official npm registry.

min-karma

Minimal Karma runner Setup and Package — Start testing now!

npm version Build Status Code Climate Dependency Status Commitizen friendly

PRs Welcome MIT License npm downloads

js-standard-style

Other minimal setups

And their combinations:

Karma

Karma is a JavaScript Test Runner, one of the most popular and friendliest for beginners. The most notable advantage of Karma is testing in real browsers. See my StackOverflow answer for more information about Karma usage.

On the AngularJS team, we rely on testing and we always seek better tools to make our life easier. That's why we created Karma - a test runner that fits all our needs.

Why?

  • Many setups are bloated with unnecessary options and packages.
  • Start clean and minimal and extend as you go.
  • Add single package to your project instead of many, to get your tests up and running.

Use cases

Features

  • [x] Minimal functional Karma config file.
  • [x] Use as repository (git clone) or package (npm install).
  • [x] Installs all testing packages as dependencies, no need to install them manually.
  • [x] Includes Chrome and Firefox launchers (but many other browsers are also supported).
  • [x] Automatically and gracefully (without overwriting) copied to your project directory via gently-copy:
    • [x] Basic testing example inside demo folder.

    • [x] Minimal functional configuration file karma.conf.js (will not install if karma.conf.js is already present):

      module.exports = function (config) {
        config.set({
          frameworks: ['jasmine'],
          files: [
            'demo/**/*.js'
          ],
          browsers: ['Chrome']
        })
      }
      

If you are new to Node

Download and Install Node.js, see How do I get started with Node.js for more information.

To use as separate Repository:

Clone

git clone https://github.com/dmitriz/min-karma

or simply Download this Repository, unzip it and cd min-karma-master.

Install dependencies

npm install --save-dev

To use as Package (add to your project):

In your main project directory (should contain package.json):

npm install min-karma --save

Getting started

Run your tests:

karma start

Now try to edit files inside demo folder and see how karma is watching and updating your test results.

Basic testing demo — inside demo folder

// function to test
function add (a, b) {
  return a + b
}

// the test
describe('Addition', function () {
  it('should add numbers', function () {
    expect(add(2, 4)).toBe(6)
    expect(add(2, 4)).not.toBe(2)
  })
})

Tip. Keep your tests next to their testees for better cohesion. Avoid putting them into separate folders (like tests) away from your code.

Enjoy! :tada:

Current Tags

  • 3.0.0                                ...           latest (a year ago)

85 Versions

  • 3.0.0                                ...           a year ago
  • 2.5.2                                ...           a year ago
  • 2.5.1                                ...           4 years ago
  • 2.4.1                                ...           4 years ago
  • 2.3.1                                ...           4 years ago
  • 2.2.13                                ...           4 years ago
  • 2.2.12                                ...           4 years ago
  • 2.2.11                                ...           4 years ago
  • 2.2.10                                ...           4 years ago
  • 2.2.9                                ...           4 years ago
  • 2.2.8                                ...           4 years ago
  • 2.2.7                                ...           4 years ago
  • 2.2.6                                ...           4 years ago
  • 2.2.5                                ...           4 years ago
  • 2.2.4                                ...           4 years ago
  • 2.2.3                                ...           4 years ago
  • 2.2.2                                ...           4 years ago
  • 2.2.1                                ...           4 years ago
  • 2.1.4                                ...           4 years ago
  • 2.1.3                                ...           4 years ago
  • 2.1.2                                ...           4 years ago
  • 2.1.1                                ...           4 years ago
  • 2.0.12                                ...           4 years ago
  • 2.0.11                                ...           4 years ago
  • 2.0.10                                ...           4 years ago
  • 2.0.9                                ...           4 years ago
  • 2.0.8                                ...           4 years ago
  • 2.0.7                                ...           4 years ago
  • 2.0.6                                ...           4 years ago
  • 2.0.5                                ...           4 years ago
  • 2.0.4                                ...           4 years ago
  • 2.0.3                                ...           4 years ago
  • 2.0.2                                ...           4 years ago
  • 2.0.1                                ...           4 years ago
  • 1.1.1                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.2                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
  • 1.0.0                                ...           5 years ago
  • 0.3.5                                ...           5 years ago
  • 0.3.4                                ...           5 years ago
  • 0.3.3                                ...           5 years ago
  • 0.3.2                                ...           5 years ago
  • 0.3.1                                ...           5 years ago
  • 0.3.0                                ...           5 years ago
  • 0.2.11                                ...           5 years ago
  • 0.2.10                                ...           5 years ago
  • 0.2.9                                ...           5 years ago
  • 0.2.8                                ...           5 years ago
  • 0.2.7                                ...           5 years ago
  • 0.2.6                                ...           5 years ago
  • 0.2.5                                ...           5 years ago
  • 0.2.4                                ...           5 years ago
  • 0.2.3                                ...           5 years ago
  • 0.2.2                                ...           5 years ago
  • 0.2.1                                ...           5 years ago
  • 0.2.0                                ...           5 years ago
  • 0.1.27                                ...           5 years ago
  • 0.1.26                                ...           5 years ago
  • 0.1.25                                ...           5 years ago
  • 0.1.24                                ...           5 years ago
  • 0.1.23                                ...           5 years ago
  • 0.1.22                                ...           5 years ago
  • 0.1.21                                ...           5 years ago
  • 0.1.20                                ...           5 years ago
  • 0.1.19                                ...           5 years ago
  • 0.1.18                                ...           5 years ago
  • 0.1.17                                ...           5 years ago
  • 0.1.16                                ...           5 years ago
  • 0.1.15                                ...           5 years ago
  • 0.1.14                                ...           5 years ago
  • 0.1.13                                ...           5 years ago
  • 0.1.12                                ...           5 years ago
  • 0.1.11                                ...           5 years ago
  • 0.1.10                                ...           5 years ago
  • 0.1.9                                ...           5 years ago
  • 0.1.8                                ...           5 years ago
  • 0.1.7                                ...           5 years ago
  • 0.1.6                                ...           5 years ago
  • 0.1.5                                ...           5 years ago
  • 0.1.4                                ...           5 years ago
  • 0.1.3                                ...           5 years ago
  • 0.1.2                                ...           5 years ago
  • 0.1.1                                ...           5 years ago
  • 0.1.0                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 0
Dependencies (6)
Dev Dependencies (1)

Copyright 2014 - 2017 © taobao.org |