Skip to content

Commit

Permalink
Merge pull request #391 from everett1992/mock.fs
Browse files Browse the repository at this point in the history
remove disabled tests for mock.fs
  • Loading branch information
tschaub authored Sep 26, 2024
2 parents 3e39479 + 40383c9 commit 16b2846
Showing 1 changed file with 0 additions and 44 deletions.
44 changes: 0 additions & 44 deletions test/lib/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -344,50 +344,6 @@ describe('The API', function () {
});
});
});

xdescribe('mock.fs()', function () {
it('generates a mock fs module with a mock file system', function (done) {
const mockFs = mock.fs({
'path/to/file.txt': 'file content',
});

mockFs.exists('path/to/file.txt', function (exists) {
assert.isTrue(exists);
done();
});
});

it('passes options to the FileSystem constructor', function () {
const mockFs = mock.fs(
{
'/path/to/file.txt': 'file content',
},
{
createCwd: false,
createTmp: false,
}
);

assert.isTrue(mockFs.existsSync('/path/to/file.txt'));
assert.deepEqual(mockFs.readdirSync('/'), ['path']);
});

it('accepts an arbitrary nesting of files and directories', function () {
const mockFs = mock.fs({
'dir-one': {
'dir-two': {
'some-file.txt': 'file content here',
},
},
'empty-dir': {},
});

assert.isTrue(mockFs.existsSync('dir-one/dir-two/some-file.txt'));
assert.isTrue(mockFs.statSync('dir-one/dir-two/some-file.txt').isFile());
assert.isTrue(mockFs.statSync('dir-one/dir-two').isDirectory());
assert.isTrue(mockFs.statSync('empty-dir').isDirectory());
});
});
});

describe('process.cwd()', function () {
Expand Down

0 comments on commit 16b2846

Please sign in to comment.