How to use the mock-fs.fs function in mock-fs

To help you get started, we’ve selected a few mock-fs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github uber / lint-trap / test / helpers / make-error-stream-fixture.js View on Github external
function createJavaScriptFixtures(destination, callback) {
    var xfs = mockfs.fs();
    var fixtureFolder = path.resolve(destination);
    xfs.exists(fixtureFolder, function existsCallback(exists) {
        if (exists) {
            return callback(new Error('destination folder exists'));
        }
        mkdirp(fixtureFolder, { fs: xfs, mode: '0755' }, mkdirpCallback);
    });

    function mkdirpCallback(err) {
        if (err) {
            return callback(err);
        }
        async.each(data, writeFixture, function foo(err) {
            if (err) {
                return callback(err);
            }
github exceptionless / Exceptionless.JavaScript / src / storage / Storage-nodespec.ts View on Github external
const nodeFileStorageInitializer = () => {
  mockedFs = mockFs.fs({
    fileStorage: {}
  });
};
github intel-iot-devkit / littleb / src / wrappers / nbind / node_modules / asyncawait / comparison / mockfs.js View on Github external
file119: 'iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii',
        },
        dir12: {},
        file11: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa',
        file12: 'b',
        file13: 'ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc',
    },
    'mocks/m2': {
        file21: 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa'
    },
    'mocks/m3': {
    }
};


var fs = Promise.promisifyAll(mock.fs(config));
module.exports = fs;
github exceptionless / Exceptionless.JavaScript / src / storage / Storage-spec.ts View on Github external
let nodeFileStorageInitializer = () => {
  mockedFs = mockFs.fs({
    'fileStorage': {}
  });
};
github expo / expo-cli / packages / xdl / __mocks__ / fs.js View on Github external
get(target, property, receiver) {
    if (target.hasOwnProperty(property)) {
      return target[property];
    } else {
      if (target.__internalFs === null) {
        target.__internalFs = mockfs.fs();
      }

      return target.__internalFs[property];
    }
  },
});
github expo / expo-cli / packages / xdl / __mocks__ / fs.js View on Github external
__configureFs: conf => {
    container.__internalFs = mockfs.fs(conf);
  },
  __mockFile: mockfs.file,

mock-fs

A configurable mock file system. You know, for testing.

MIT
Latest version published 8 days ago

Package Health Score

80 / 100
Full package analysis