This is a lightweight Mocha runner for Vim. Extracted from vim-spec
Based off of Attamusc/vim-mocha and subsequently thoughtbot/vim-rspec.
Use both RSpec and Mocha? Take a look at vim-spec!
Using vundle:
Bundle 'geekjuice/vim-mocha'
If using zsh on OS X it may be necessary to run move /etc/zshenv
to /etc/zshrc
.
Using pathogen
cd ~/.vim/bundle
git clone git://github.com/geekjuice/vim-spec.git
Using vim-plug
Plug 'geekjuice/vim-mocha'
NOTE: The mappings have changed and use the same mappings as vim-rspec and vim-spec. If this is a big issue for you, open an issue and I'll re-add/add the namespace.
map <Leader>t :call RunCurrentSpecFile()<CR>
map <Leader>s :call RunNearestSpec()<CR>
map <Leader>l :call RunLastSpec()<CR>
map <Leader>a :call RunAllSpecs()<CR>
Like thoughtbot/vim-rspec, the following variables can be overwritten for custom spec commands:
g:mocha_js_command
g:mocha_coffee_command
Examples:
let g:mocha_js_command = "!mocha --recursive --no-colors {spec}"
let g:mocha_coffee_command = "!mocha -b --compilers coffee:coffee-script{spec}"
" Using test runners
let g:mocha_coffee_command = "!cortado {spec}"
Note: cortado is a sugar wrapper for a more complex mocha
call.
-
Allow configuration for
mocha
options i.e.--recursive
,--reporter dot
-
BUG: Last nearest test fails if below
it
call
mocha.vim is released under the MIT License.