Text
Page: 1
Getting
started with
vim-test
2016/10/13
Page: 2
Why?
run your tests with one
command
support for many test
frameworks:
rspec, vader, gotest, phpunit,
pytest, …
Page: 3
Commands
:TestNearest: Runs the test
nearest to the cursor
:TestFile: Test the whole
file
:TestSuite: Runs all tests
:TestLast: Runs the last
test command again
Page: 4
Strategies
dispatch, vimux, neovim
make, tslime, vimproc
Page: 5
Defining strategies
let test#strategy =
"dispatch"
or more granular:
let test#strategy = {
\ ‘nearest’: ‘vimux’,
\ ‘suite’: ‘dispatch’
}
Page: 6
Chose strategy via
commandline
:TestNearest -strategy=basic
Page: 7
CLI options
:TestNearest --backtrace
or configure it:
let test#ruby#rspec#options = '-f html'
Page: 8
Mappings
nmap <silent> <leader>t :TestNearest<CR>
nmap <silent> <leader>T :TestFile<CR>
nmap <silent> <leader>a :TestSuite<CR>
nmap <silent> <leader>l :TestLast<CR>
nmap <silent> <leader>g :TestVisit<CR>
Page: 9
Alternative: plain
dispatch
:Dispatch rspec %
:Dispatch bundle exec rspec
:execute "Dispatch rspec " . expand("%") . ":" . line(".")