How to use the memfs.vol.mkdirpSync function in memfs

To help you get started, we’ve selected a few memfs 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 thiagodp / concordialang / __tests__ / plugin / PackageBasedPluginFinder.spec.ts View on Github external
it( 'prefers local than global', async () => {

        vol.mkdirpSync( localPluginDir ); // local
        vol.writeFileSync( localPluginPackageFile, JSON.stringify( pkg ) ); // local

        const pkg2 = { ... pkg }; // copy properties

        vol.mkdirpSync( globalPluginDir ); // global
        vol.writeFileSync( globalPluginPackageFile, JSON.stringify( pkg2 ) ); // global

        const finder: PackageBasedPluginFinder = new PackageBasedPluginFinder( currentDir, fs );
        const pluginData: PluginData[] = await finder.find();
        expect( pluginData ).toHaveLength( 1 );

        const first = pluginData[ 0 ];

        expect( first.name ).toEqual( pkg.name );
    } );
github thiagodp / concordialang / __tests__ / plugin / PackageBasedPluginFinder.spec.ts View on Github external
it( 'ignores a package that is not a plugin', async () => {

        vol.mkdirpSync( localPluginDir ); // local
        vol.writeFileSync( localPluginPackageFile, JSON.stringify( pkg ) ); // local

        const pkg2 = { ... pkg }; // copy properties
        pkg2.name += '-non-plugin';
        pkg2[ PLUGIN_PROPERTY ] = undefined; // removes the expected property

        vol.mkdirpSync( join( localModulesDir, pkg2.name ) );
        vol.writeFileSync( join( localModulesDir, pkg2.name, PKG_FILENAME ), JSON.stringify( pkg2 ) );

        const finder: PackageBasedPluginFinder = new PackageBasedPluginFinder( currentDir, fs );
        const pluginData: PluginData[] = await finder.find();
        expect( pluginData ).toHaveLength( 1 );
    } );
github thiagodp / concordialang / __tests__ / plugin / PackageBasedPluginFinder.spec.ts View on Github external
it( 'returns class file with path', async () => {

        vol.mkdirpSync( localPluginDir ); // local
        vol.writeFileSync( localPluginPackageFile, JSON.stringify( pkg ) ); // local

        const pkg2 = { ... pkg }; // copy properties
        pkg2.name += '-global';

        vol.mkdirpSync( globalPluginDir ); // global
        vol.writeFileSync( globalPluginPackageFile, JSON.stringify( pkg2 ) ); // global

        const finder: PackageBasedPluginFinder = new PackageBasedPluginFinder( currentDir, fs );
        const pluginData: PluginData[] = await finder.find();
        expect( pluginData ).toHaveLength( 2 );

        const first = pluginData[ 0 ];

        expect( first.file ).toContain( localPluginDir );
    } );
github thiagodp / concordialang / __tests__ / plugin / PackageBasedPluginFinder.spec.ts View on Github external
beforeEach( () => {
        vol.mkdirpSync( currentDir, { recursive: true } ); // Synchronize - IMPORTANT! - mkdirpSync, not mkdirSync
        vol.mkdirpSync( localModulesDir );
        vol.mkdirpSync( globalModulesDir ); // Global modules directory
    } );
github thiagodp / concordialang / __tests__ / plugin / PackageBasedPluginFinder.spec.ts View on Github external
beforeEach( () => {
        vol.mkdirpSync( currentDir, { recursive: true } ); // Synchronize - IMPORTANT! - mkdirpSync, not mkdirSync
        vol.mkdirpSync( localModulesDir );
        vol.mkdirpSync( globalModulesDir ); // Global modules directory
    } );
github thiagodp / concordialang / __tests__ / plugin / PackageBasedPluginFinder.spec.ts View on Github external
beforeEach( () => {
        vol.mkdirpSync( currentDir, { recursive: true } ); // Synchronize - IMPORTANT! - mkdirpSync, not mkdirSync
        vol.mkdirpSync( localModulesDir );
        vol.mkdirpSync( globalModulesDir ); // Global modules directory
    } );
github smartive / kuby / test / commands / kubectl / kubectl.utils.kubectl.spec.ts View on Github external
it('should filter invalid versions', async () => {
      vol.mkdirpSync(posix.join(Filepathes.kubectlInstallPath, 'v1.10.0'));
      vol.mkdirpSync(posix.join(Filepathes.kubectlInstallPath, 'v1.12.0'));
      vol.mkdirpSync(posix.join(Filepathes.kubectlInstallPath, 'v1.13.0'));
      vol.mkdirpSync(posix.join(Filepathes.kubectlInstallPath, 'miepmiep'));
      const result = await Helpers.getLocalVersions();
      expect(result).toEqual(['1.13.0', '1.12.0', '1.10.0']);
    });
  });
github smartive / kuby / test / commands / kubectl / kubectl.remove.spec.ts View on Github external
beforeEach(() => {
    vol.fromJSON({
      [posix.join(Filepathes.kubectlInstallPath, 'v1.12.1', 'kubectl')]: 'kubectl',
      [posix.join(Filepathes.kubectlInstallPath, 'v1.12.2', 'kubectl')]: 'kubectl',
      [posix.join(Filepathes.kubectlInstallPath, 'v1.10.0', 'kubectl')]: 'kubectl',
      [posix.join(Filepathes.kubectlInstallPath, 'v1.8.4', 'kubectl')]: 'kubectl',
    });
    vol.mkdirpSync('/usr/local/bin/');
    vol.symlinkSync(posix.join(Filepathes.kubectlInstallPath, 'v1.10.0', 'kubectl'), '/usr/local/bin/kubectl');
  });
github smartive / kuby / test / commands / kubectl / kubectl.use.spec.ts View on Github external
beforeEach(() => {
    vol.fromJSON({
      [posix.join(Filepathes.kubectlInstallPath, 'v1.12.1', 'kubectl')]: 'v1.12.1',
      [posix.join(Filepathes.kubectlInstallPath, 'v1.12.2', 'kubectl')]: 'v1.12.2',
      [posix.join(Filepathes.kubectlInstallPath, 'v1.10.0', 'kubectl')]: 'v1.10.0',
      [posix.join(Filepathes.kubectlInstallPath, 'v1.8.4', 'kubectl')]: 'v1.8.4',
    });
    vol.mkdirpSync('/usr/local/bin/');
    vol.symlinkSync(posix.join(Filepathes.kubectlInstallPath, 'v1.10.0', 'kubectl'), '/usr/local/bin/kubectl');
  });