0.3.2 • Published 7 years ago

fileception v0.3.2

Weekly downloads
131
License
BSD-3-Clause
Repository
-
Last release
7 years ago

fileception

Mock out the FS module during a test, experimentally extracted from unexpected-fs:

var fileception = require('fileception');
var assert = require('assert');
var fs = require('fs');

it('should read the contents of a file', function () {
    fileception({
        '/foo': {
            'bar.txt': 'quux'
        }
    });

    assert.equal(fs.readFileSync('/foo/bar.txt', 'utf-8'), 'quux');
});

When the test is done, the fs module will automatically be restored.

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.0

7 years ago