Ⅰ. 插件描述
A Vim plugin that uses the qunit-special-blend npm module to allow the user to run single qunit tests from a test suite.Ⅱ. 基本信息
|
Ⅲ. 安装方法
使用Vundle管理器安装
在你的.vimrc下添加:Plugin 'jarrodctaylor/vim-qunit-special-blend'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall
对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。
使用NeoBundle管理器安装
在你的.vimrc下添加:NeoBundle 'jarrodctaylor/vim-qunit-special-blend'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall
使用VimPlug管理器安装
在你的.vimrc下添加:Plug 'jarrodctaylor/vim-qunit-special-blend'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall
使用Pathogen管理器安装
在终端中运行以下命令:cd ~/.vim/bundle
git clone https://github.com/jarrodctaylor/vim-qunit-special-blend
Ⅳ. 文档说明
# vim-qunit-special-blend
Ever want to run a single qunit test from your test suite with karma?
Yeah, so did I.
This plugin was created to leverage the functionality provided by thekarma-quint-special-blend npm package to run QUnit tests from within Vim. With this
plugin you will be able to run all of your tests, a single test module, and
even an individual test.
The Plugin In Action
JavaScript: Notice how there are 3 tests and we only run one of them.
CoffeeScript: Here we only run the first module which has two tests.
Installation
Use your plugin manager of choice.
git clone https://github.com/JarrodCTaylor/vim-qunit-special-blend ~/.vim/bundle/vim-qunit-special-blend
- Add
Bundle 'https://github.com/JarrodCTaylor/vim-qunit-special-blend'to .vimrc - Run
:BundleInstall
- Add
- Add
NeoBundle 'https://github.com/JarrodCTaylor/vim-qunit-special-blend'to .vimrc - Run
:NeoBundleInstall
- Add
- Add
Plug 'https://github.com/JarrodCTaylor/vim-qunit-special-blend'to .vimrc - Run
:PlugInstall
- Add
Requirements
This plugin assumes that you are running your JavaScript tests with karma.
You will need to npm install karma-qunit-special-blend. Then in your projects karma.conf.js
have the frameworks array configured as follows:
frameworks: ['qunit', 'qunit-sb'],Usage
The plugin provides four commands:
RunAllQunitTests
RunSingleQunitModule
RunSingleQunitTest
RunSingleAsyncQunitTestEnsure that your cursor is within a module or test as appropriate for the
desired command that you are trying to run.
Custom Settings
The plugin assumes that your JS tests are configured to be run with `grunt
test` from the command line. If this is not the case you can specify the
command that will run your tests with the special_blend_run variable in your.vimrc like so:
let g:special_blend_run='karma start'