-
Notifications
You must be signed in to change notification settings - Fork 774
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
f5c1e80
commit 1b73ffe
Showing
3 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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,36 @@ | ||
var assert = require('assert') | ||
var path = require('path') | ||
var os = require('os') | ||
var fse = require(process.cwd()) | ||
|
||
/* global before, describe, it */ | ||
|
||
describe('mkdirp: issue-93, win32, when drive does not exist, it should return a cleaner error', function () { | ||
var TEST_DIR | ||
|
||
// only seems to be an issue on Windows. | ||
if (process.platform !== 'win32') return | ||
|
||
before(function (done) { | ||
TEST_DIR = path.join(os.tmpdir(), 'tests', 'fs-extra', 'mkdirp-issue-93') | ||
fse.emptyDir(TEST_DIR, function (err) { | ||
assert.ifError(err) | ||
done() | ||
}) | ||
}) | ||
|
||
it('should return a cleaner error than inifinite loop, stack crash', function (done) { | ||
var file = 'r:\\afasd\\afaff\\fdfd' // hopefully drive 'r' does not exist on appveyor | ||
fse.mkdirp(file, function (err) { | ||
assert.strictEqual(err.code, 'ENOENT') | ||
|
||
try { | ||
fse.mkdirsSync(file) | ||
} catch (err) { | ||
assert.strictEqual(err.code, 'ENOENT') | ||
} | ||
|
||
done() | ||
}) | ||
}) | ||
}) |
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