test-helpers
Version:
Node.js path and fs helpers for things like reading fixtures and writing results while running tests.
62 lines (40 loc) • 1.38 kB
Markdown
> Node.js path and fs helpers for things like reading fixtures and writing results while running tests.
```bash
npm i test-helpers --save-dev
```
```js
var helpers = require('test-helpers')([options]);
```
**Options**
* `dir`: the base directory for tests. default is `test`
* `fixtures`: the base directory for test fixtures. default is `test/fixtures`
* `actual`: the base directory for test results. default is `test/actual`
Options can be defined on the `helpers()` function, or with `helpers.option()`.
**Examples**:
Change the default directories to use for tests:
```js
var helpers = require('test-helpers')({
dir: 'test',
fixtures: 'test/fixtures',
dir: 'test/actual'
});
```
Or use the `.option()` method:
```js
helpers.option('dir', 'test');
helpers.option('fixtures', 'test/fixtures');
helpers.option('actual', 'test/actual');
```
**Jon Schlinkert**
+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert)
Copyright (c) 2014 Jon Schlinkert, contributors.
Released under the MIT license
***
_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on August 11, 2014._