This is a lightweight Karma runner for Vim, like vim-rspec.
Install vim plugin
Bundle 'maksimr/vim-karma'
Install karma-cli
npm install -g karma-cli
Install karma in porject
npm install karma
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')
For testing vim files we use vim-vspec
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
Files with tests for vim located in directory t
For executing vim tests you should run command:
bundle exec rake test
For run tests on every change of vim files
in folders plugin
and t
guard