Welcome to mirror list, hosted at ThFree Co, Russian Federation.

fs.spec.js « acceptance « test « mocha-3.1.2 « lib « tests - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
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();
    });
  });
});