0

Istanbul seems great - seen lots of awesomeness there. Even blanket seems pretty cool. But none seem to play nice, and if they do, I can't figure out how to get it to play with grunt and if I can, I'm left with the problem of running coffee-script.

For example, this post gives a great example and it seems great, but no grunt! Any help?

Shamoon
  • 41,293
  • 91
  • 306
  • 570

1 Answers1

1

I'm using one grunt library for that. It's called Grunt Mocha Test.

It plays well when your mocha tests are for nodejs backend project. I hope my configuration helps you :

mochaTest:
  options:
    require:
      - 'coffee-script/register'
      - './test/mocha.coffee'
      - 'coverage/blanket'
    quiet: true
    reporter: 'html-cov'
    captureFile: 'coverage.html'
  src:
    - 'test/**/*.coffee'

The format for my grunt configuration files is in yaml, because I'm using another plugin that separates the tasks.

my mocha.coffee file looks something like this :

# Initialize Should for chai
global.chai = require 'chai'
global.chai.use require 'chai-as-promised'
global.chai.config.includeStack = true
global.should = chai.should()
drinchev
  • 19,201
  • 4
  • 67
  • 93