Created
November 7, 2015 23:21
-
-
Save bcomnes/9d1d773b5c66ca17ca5b to your computer and use it in GitHub Desktop.
test with temp dirs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var test = require('tape') | |
| var tmp = require('temporary-directory') | |
| var tempDir | |
| var cleanupTestDir | |
| test('set up temp dir', function (t) { | |
| tmp('bigup', function created (err, dir, cleanup) { | |
| t.error(err, 'temp dir created without error') | |
| cleanupTestDir = cleanup | |
| tempDir = dir | |
| t.end() | |
| }) | |
| }) | |
| // test goes here | |
| test('clean up test dir', function (t) { | |
| cleanupTestDir(function (err) { | |
| t.error(err, 'test dir removed without error') | |
| t.end() | |
| }) | |
| }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment