Giter VIP home page Giter VIP logo

vim-mocha's Introduction

vim-mocha

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!

Installation

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'

Example of key mappings

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>

Configuration

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.

Notes

  • Allow configuration for mocha options i.e. --recursive, --reporter dot

  • BUG: Last nearest test fails if below it call

Credits

thoughtbot/vim-rspec

Attamusc/vim-mocha

License

mocha.vim is released under the MIT License.

vim-mocha's People

Contributors

geekjuice avatar wmonk avatar yannvanhalewyn avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.