1 | var fs = require('fs');
|
2 | var path = require('path');
|
3 |
|
4 | var rimraf = require('rimraf');
|
5 |
|
6 | var tmpPath = '.tmp';
|
7 |
|
8 |
|
9 | /**
|
10 | * Test setup. Not timed.
|
11 | * @param {function(Error)} done Callback.
|
12 | */
|
13 | exports.beforeEach = function(done) {
|
14 | fs.mkdir(tmpPath, done);
|
15 | };
|
16 |
|
17 |
|
18 | /**
|
19 | * Timed test.
|
20 | * @param {function(Error)} done Callback.
|
21 | */
|
22 | exports.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 | */
|
31 | exports.afterEach = function(done) {
|
32 | rimraf(tmpPath, done);
|
33 | };
|