UNPKG

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
# test-helpers [![NPM version](https://badge.fury.io/js/test-helpers.png)](http://badge.fury.io/js/test-helpers) > Node.js path and fs helpers for things like reading fixtures and writing results while running tests. ## Install #### Install with [npm](npmjs.org): ```bash npm i test-helpers --save-dev ``` ## Usage ```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'); ``` ## Author **Jon Schlinkert** + [github/jonschlinkert](https://github.com/jonschlinkert) + [twitter/jonschlinkert](http://twitter.com/jonschlinkert) ## License 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._