mocha-fixture-dir
Create/copy directories to automatically cleaned up temporary directories via Mocha
More information on the repository can be found in fixture-dir's
documentation.
Getting Started
Install the module with: npm install mocha-fixture-dir
// Generate our fixture utilsvar exec = exec;var FixtureDir = ;var mochaFixtureDir = ;var fixtureUtils = ; // Generate a tmp namespace for our testsfixtureUtils; // Copy over folder contents (`git-log`) to temporary directory (`/tmp/my-node-module-tests/git-log`)// This also cleans up the directory on `after`fixtureUtils;; ;
Documentation
mocha-fixture-dir
returns mochaFixtureDir
as its module.exports
.
mochaFixtureDir(FixtureDir)
Factory that wraps a FixtureDir
instance with Mocha methods.
Returns:
- fixtureUtils
FixtureUtils
, object with methods for creating/interacting with aFixtureDir
inMocha's before/after
contexts
FixtureUtils
FixtureUtils#init(folderName)
Initialize the FixtureDir
constructor inside of a before
block. This must be run before any other FixtureUtils
calls.
FixtureUtils#mkdir(options)
Runs FixtureDir#mkdir
on the current FixtureDir
instance inside a Mocha's before
block. Additionally, it cleans up the directory via FixtureDir#destroy
in an after
block.
Contributing
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint via grunt and test via npm test
.
Donating
Support this project and others by twolfson via gittip.
Unlicense
As of Apr 13 2014, Todd Wolfson has released this repository and its contents to the public domain.
It has been released under the UNLICENSE.