blob: 9d0357c38213b02e4d5c8deb7d00d232c8db23b8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
'use strict';
var fs = require('fs');
var path = require('path');
var os = require('os');
var tmpFile = path.join.bind(path, os.tmpdir());
describe('fs.readFile()', function () {
describe('when the file exists', function () {
it('should succeed', function (done) {
fs.writeFile(tmpFile('mocha'), 'wahoo', done);
});
});
describe('when the file does not exist', function () {
it('should fail', function (done) {
// uncomment
// fs.readFile(tmpFile('does-not-exist'), done);
done();
});
});
});
|