yamadapc / jsdoctest

Run jsdoc examples as doctests.
https://yamadapc.github.io/jsdoctest
MIT License
92 stars 9 forks source link

Feature Request: Ability to set `beforeEach` and `AfterEach` statments #19

Open reggi opened 8 years ago

reggi commented 8 years ago

The async capabilities are super nice.

 * @example
 * symlinkPath("./foo.txt", "./dir-foo/symlink.txt", cb)
 * // async => "./foo.txt"

I just need the ability to add in a file-system mock and I'd be golden.

var mock = require('mock-fs')
beforeEach(function(){
    mock({
      'foo.txt': 'foo\n',
      'empty-dir': {},
      'dir-foo': {
        'foo.txt': 'foo\n',
      },
      'dir-bar': {
        'bar.txt': 'bar\n',
      },
    })
  })

  afterEach(function() {
    mock.restore()
  })
reggi commented 8 years ago

At this point I'd just appreciate any way of writing tests easier.