Skip to content

Commit

Permalink
(#209) created a test for mkdirp() bad path
Browse files Browse the repository at this point in the history
  • Loading branch information
jprichardson committed Apr 17, 2016
1 parent 1b73ffe commit 7e1cb66
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions lib/mkdirs/__tests__/issue-209.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var assert = require('assert')
var fse = require(process.cwd())

/* global describe, it */

describe('mkdirp: issue-209, win32, when bad path, should return a cleaner error', function () {
// only seems to be an issue on Windows.
if (process.platform !== 'win32') return

it('should return a cleaner error than inifinite loop, stack crash', function (done) {
var file = './bad?dir'
fse.mkdirp(file, function (err) {
assert.strictEqual(err.code, 'ENOENT')
done()
})
})
})

0 comments on commit 7e1cb66

Please sign in to comment.