Skip to content

jvalkeejarvi/karma.el

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

87 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License GPL 3 Build Status Coverage Status MELPA MELPA Stable

karma.el

Karma Test Runner Emacs Integration


Installation

Installation via package.el

package.el is the built-in package manager in Emacs.

Karma.el is available on the three major community maintained repositories - MELPA STABLE, MELPA and Marmalade.

You can install Karma with the following commnad:

M-x package-install [RET] karma [RET]

or by adding this bit of Emacs Lisp code to your Emacs initialization file (.emacs or init.el):

(unless (package-installed-p 'karma)
  (package-install 'karma))

If the installation doesn't work try refreshing the package list:

M-x package-refresh-contents [RET]

Keep in mind that MELPA packages are built automatically from the master branch, meaning bugs might creep in there from time to time. Never-the-less, installing from MELPA is the recommended way of obtaining Karma, as the master branch is normally quite stable and "stable" (tagged) builds are released somewhat infrequently.

With the most recent builds of Emacs, you can pin Karma to always use MELPA Stable by adding this to your Emacs initialization:

(add-to-list 'package-pinned-packages '(karma . "melpa-stable") t)

Via el-get

el-get is another popular package manager for Emacs. If you're an el-get user just do M-x el-get-install [RET] karma [RET].

Manual

You can install Karma manually by placing it on your load-path and require ing it. Many people favour the folder ~/.emacs.d/vendor.

(add-to-list 'load-path "~/.emacs.d/vendor/karma.el/")
(require 'karma)

Usage

Basic setup

You need to create an .karma file inside your project directory to inform Karma.el where to get the Karma config file and the Karma executable.

{
  "config-file": "karma.coffee",
  "karma-command": "node_modules/karma/bin/karma"
}

The config-file and the karma-command paths need to be relative or absolute to your project directory.

Interactive Commands

Keybinding Description
C-c , t Runs karma-start in the root directory of the project.
C-c , s s Runs karma-start-single-run in the root directory of the project.
C-c , n s Runs karma-start-no-single-run in the root directory of the project.
C-c , r Runs karma-run in the root directory of the project.
C-c , p Pop to the *Karma start* buffer if exists.
C-c , c Runs karma-run-current-test.

Contributing

Contributions are very welcome!

  1. Fork karma.el
  2. Create a topic branch - git checkout -b my_branch
  3. Push to your branch - git push origin my_branch
  4. Send me a pull-request for your topic branch
  5. That's it!

License

Copyright © 2014 Samuel Tonini and contributors.

Distributed under the GNU General Public License, version 3

About

Karma Test Runner Emacs Integration

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Emacs Lisp 92.9%
  • Makefile 7.1%