How to use the mock-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 sakuli / sakuli / packages / sakuli-legacy / src / loader / legacy-loader.class.spec.ts View on Github external
beforeEach(async function mockValidProjectLayout(done) {
            mockFs({
                'path/to/testsuites': {
                    'sakuli.properties': `
                        sakuli.environment.similarity.default=0.99
                    `,
                    'suite': {
                        'testsuite.properties': `testsuite.name=test`,
                        'testsuite.suite': stripIndent`
                            case1/sakuli_demo.js http://sahi.example.com/_s_/dyn/Driver_initialized
                            case2/sakuli_demo.js http://sahi.example.com/_s_/dyn/Driver_initialized
                        `,
                        case1: {
                            'sakuli_demo.js': '// Test'
                        },
                        case2: {
                            'sakuli_demo.js': '// Test'
                        }
github dtysky / MoeNotes / spec / testcase-storage-book.js View on Github external
export function initWithoutTree(){
    mock(filesWithoutTree);
}
github dtysky / MoeNotes / spec / testcase-storage-book.js View on Github external
export function initEmpty(){
    mock(filesEmpty);
}
github dtysky / MoeNotes / spec / testcase-storage-top.js View on Github external
export function initWithErrorTree() {
    mock(filesWithErrorTree);
}
github ewnd9 / media-center / test / find-files-spec.js View on Github external
function mockFs() {
  mock({
    [testDir]: {
      [showFolder]: mock.directory({
        birthtime: pastDate,
        items: {
          [showFile1]: f(pastDate),
          [showFile2]: f(pastDate),
          [showFile3]: f(pastDate),
          [showFile4]: f(pastDate)
        }
      }),
      [movieFolder]: mock.directory({
        birthtime: nearestDate,
        items: {
          [movieFile]: f(nearestDate)
        }
      })
github dtysky / MoeNotes / spec / testcase-storage-top.js View on Github external
export function initWithTree(){
    mock(filesWithTree);
}
github adogor / npm-autolink / test / support / utils.js View on Github external
export function mockFsWithCwd(config, cwd) {
  mockFs(config, {
    createCwd: false
  });
  process.chdir(cwd);
}
github drud / ddev-ui / test / cms-installer.js View on Github external
beforeEach(done => {
      mockFS(mockFileSystem);
      done();
    });
github dtysky / MoeNotes / spec / testcase-storage-top.js View on Github external
export function initWithoutTree(){
    mock(filesWithoutTree);
}
github nicolas-schmitt / multi-git / test / directory.spec.js View on Github external
before(function() {
        mockfs(mockTree);
        this.spawn = childProcess.spawn;
    });

mock-fs

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

MIT
Latest version published 1 year ago

Package Health Score

68 / 100
Full package analysis