Failing test for #267, readdir on file path should error
This commit is contained in:
parent
e01e422fe9
commit
4bba2512b0
|
@ -0,0 +1,22 @@
|
|||
var Filer = require('../..');
|
||||
var util = require('../lib/test-utils.js');
|
||||
var expect = require('chai').expect;
|
||||
|
||||
describe('fs.readdir on non-dir paths, issue 267', function() {
|
||||
beforeEach(util.setup);
|
||||
afterEach(util.cleanup);
|
||||
|
||||
it('should fail with ENOTDIR when called on filepath', function(done) {
|
||||
var fs = util.fs();
|
||||
|
||||
fs.writeFile('/myfile.txt', 'data', function(err) {
|
||||
if(err) throw err;
|
||||
|
||||
fs.readdir('/myfile.txt', function(err, contents) {
|
||||
expect(err).to.exist;
|
||||
expect(err.code).to.equal('ENOTDIR');
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
|
@ -73,3 +73,4 @@ require("./bugs/ls-depth-bug");
|
|||
require("./bugs/issue247.js");
|
||||
require("./bugs/issue254.js");
|
||||
require("./bugs/issue258.js");
|
||||
require("./bugs/issue267.js");
|
||||
|
|
Loading…
Reference in New Issue