UNPKG

572 BJavaScriptView Raw
1var fs = require('fs');
2var path = require('path');
3
4var rimraf = require('rimraf');
5
6var tmpPath = '.tmp';
7
8
9/**
10 * Test setup. Not timed.
11 * @param {function(Error)} done Callback.
12 */
13exports.beforeEach = function(done) {
14 fs.mkdir(tmpPath, done);
15};
16
17
18/**
19 * Timed test.
20 * @param {function(Error)} done Callback.
21 */
22exports.test = function(done) {
23 fs.writeFile(path.join(tmpPath, 'foo-real.txt'), 'foo', done);
24};
25
26
27/**
28 * Test teardown. Not timed.
29 * @param {function(Error)} done Callback.
30 */
31exports.afterEach = function(done) {
32 rimraf(tmpPath, done);
33};