How to use metro-memory-fs - 1 common examples

To help you get started, we’ve selected a few metro-memory-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 react-native-community / cli / __mocks__ / fs.js View on Github external
function reset(platform) {
  if (path.mock == null) {
    throw new Error(
      'to use this "fs" module mock, you must also mock the "path" module',
    );
  }
  path.mock.reset(platform);
  const cwd = () => (platform === 'win32' ? 'c:\\' : '/');
  fs = new MemoryFS({platform, cwd});
  Object.assign(mockFs, fs);
}

metro-memory-fs

🚇 A memory-based implementation of `fs` useful for testing.

MIT
Latest version published 2 months ago

Package Health Score

93 / 100
Full package analysis

Popular metro-memory-fs functions

Similar packages