vim-karma


Ⅰ. 插件描述

This is a lightweight Karma runner for Vim, like vim-rspec

Ⅱ. 基本信息

创建日期:  2014-05-02
使用用户:  1
Github星:  1
插件作者:  Maksim Ryzhikov

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'maksimr/vim-karma'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'maksimr/vim-karma'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'maksimr/vim-karma'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/maksimr/vim-karma

Ⅳ. 文档说明

# vim-karma

Description

This is a lightweight Karma runner for Vim, like vim-rspec.

Installation

Install vim plugin

    Bundle 'maksimr/vim-karma'

Install karma-cli

    npm install -g karma-cli

Install karma in porject

    npm install karma

Configuration

Key mappings
Add your preferred key mappings to your .vimrc file.

map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>

All functions which run special file or test case actually only for mocha!

  • RunNearestSpec - Run nearest it
  • RunNearestTestCase - Run nearest it
  • RunNearestTestSuite - Run nearest describe
  • RunSpecs - By defaul run all specs. You can pass grep string how parrams RunSpecs('Test')

Tests

For testing vim files we use vim-vspec

Setup environment

Before run vim tests you should setup test environment.
Inside plugin directory run follow commands:

Before all steps you should install ruby and gems

This install all needed gems for tests

    gem install bundle
    bundle install

The structure of directories

Files with tests for vim located in directory t

Run

For executing vim tests you should run command:

    bundle exec rake test

Watch

For run tests on every change of vim files
in folders plugin and t

    guard

添加新评论