forked from mantoni/mochify.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolve relative path to external bundle when passing to consolify
Fixes mantoni#140 Add Test Coverage for --bundle and --consolify args * Fail with a useful error if the user tries to use --bundle wihout --consolify * Add test-coverage to check that both the consolify'd HTML and extracted bundle are written to disk
- Loading branch information
1 parent
b74bf9e
commit 290fd38
Showing
7 changed files
with
84 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* | ||
* mochify.js | ||
* | ||
* Copyright (c) 2014 Maximilian Antoni <[email protected]> | ||
* | ||
* @license MIT | ||
*/ | ||
'use strict'; | ||
|
||
var tmp = require('tmp'); | ||
|
||
// sandbox creates a temporary directory which will be automatically | ||
// removed after the testcase completes. | ||
function sandbox(testfn) { | ||
return function (done) { | ||
var tmpOpts = { | ||
unsafeCleanup: true | ||
}; | ||
tmp.dir(tmpOpts, function (err, tmpdir) { | ||
if (err) { | ||
return done(err); | ||
} | ||
testfn(done, tmpdir); | ||
}); | ||
}; | ||
} | ||
|
||
module.exports = sandbox; |