How to use the temp.mkdirSync function in temp

To help you get started, we’ve selected a few temp 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 atom / github / test / helpers.js View on Github external
export async function cloneRepository(repoName = 'three-files') {
  if (!cachedClonedRepos[repoName]) {
    const cachedPath = temp.mkdirSync('git-fixture-cache-');
    const git = new GitShellOutStrategy(cachedPath);
    await git.clone(path.join(__dirname, 'fixtures', `repo-${repoName}`, 'dot-git'), {noLocal: true});
    await git.exec(['config', '--local', 'core.autocrlf', 'false']);
    await git.exec(['config', '--local', 'commit.gpgsign', 'false']);
    await git.exec(['config', '--local', 'user.email', FAKE_USER.email]);
    await git.exec(['config', '--local', 'user.name', FAKE_USER.name]);
    await git.exec(['config', '--local', 'push.default', 'simple']);
    await git.exec(['checkout', '--', '.']); // discard \r in working directory
    cachedClonedRepos[repoName] = cachedPath;
  }
  return copyCachedRepo(repoName);
}
github atom / git-utils / spec / git-spec.js View on Github external
it('relativizes against both the linked path and the real path', () => {
        // Creating symbol link on Windows requires administrator permission so
        // we just skip this test.
        if (process.platform === 'win32') { return }

        const repoDirectory = fs.realpathSync(temp.mkdirSync('node-git-repo-'))
        const linkDirectory = path.join(fs.realpathSync(temp.mkdirSync('node-git-repo-')), 'link')
        wrench.copyDirSyncRecursive(path.join(__dirname, 'fixtures/master.git'), path.join(repoDirectory, '.git'))
        fs.symlinkSync(repoDirectory, linkDirectory)

        repo = git.open(linkDirectory)
        expect(repo.relativize(path.join(repoDirectory, 'test1'))).toBe('test1')
        expect(repo.relativize(path.join(linkDirectory, 'test2'))).toBe('test2')
        expect(repo.relativize(path.join(linkDirectory, 'test2/test3'))).toBe('test2/test3')
        expect(repo.relativize('test2/test3')).toBe('test2/test3')
      })
    })
github aidistan / atom-symbols-view-plus / spec / symbols-view-spec.js View on Github external
beforeEach(async () => {
    jasmine.unspy(global, 'setTimeout');

    atom.project.setPaths([
      temp.mkdirSync('other-dir-'),
      temp.mkdirSync('atom-symbols-view-'),
    ]);

    directory = atom.project.getDirectories()[1];
    fs.copySync(path.join(__dirname, 'fixtures', 'js'), atom.project.getPaths()[1]);

    activationPromise = atom.packages.activatePackage('symbols-view-plus');
    jasmine.attachToDOM(getWorkspaceView());

    // NOTE: to be compatible with atom/symbols-view
    atom.config.set(
      'symbols-view-plus.plusConfigurations.symbolsViewTheme',
      'Modal Panel (like atom/symbols-view)'
    );
  });
github rhumaric / generator-playground / test / test-creation.js View on Github external
function runGenerator(context, promptAnswers, done) {
  
  var workspace = context.workspace = temp.mkdirSync();
  helpers.testDirectory(workspace, function (err) {

    if (err) {
      return done(err);
    }

    this.app = helpers.createGenerator('playground:app', [
      path.resolve(__dirname, '../app')
    ]);

    helpers.mockPrompt(this.app, promptAnswers);

    this.app.options['skip-install'] = true;

    console.log('Default run');
    this.app.run({}, function () {
github JonAbrams / synth / test / synth_command.js View on Github external
beforeEach(function () {
    var rootDir = temp.mkdirSync('synth-tests');
    process.chdir(rootDir);
  });
github taku-o / myukkurivoice / test / specWindow-service-apputil.ts View on Github external
before(function() {
    const fsprefix = `_myubo_test${Date.now().toString(36)}`;
    const dirPath = temp.mkdirSync(fsprefix);
    this.app = new Application({
      path: 'MYukkuriVoice-darwin-x64/MYukkuriVoice.app/Contents/MacOS/MYukkuriVoice',
      chromeDriverArgs: ['remote-debugging-port=9222'],
      env: {DEBUG: 1, NODE_ENV: 'test', userData: dirPath},
    });
    return this.app.start();
  });
github FreeAllMedia / akiro / es6 / spec / akiro / akiro.package.spec.js View on Github external
beforeEach(function (done) {
		this.timeout(10000);
		packageDetails = {
			"async": "1.x.x",
			"incognito": "0.1.4"
		};

		outputDirectoryPath = `${temp.mkdirSync("akiro.output")}/some/deep/dir`;
		cacheDirectoryPath = `${temp.mkdirSync("akiro.cache")}`;

		lambdaConstructorSpy = sinon.spy();
		s3ConstructorSpy = sinon.spy();

		mockAsync = {
			parallel: sinon.spy(Async.parallel)
		};

		mockLambda = {
			invoke: sinon.spy((parameters, invokeCallback) => {
				const payloadData = JSON.parse(parameters.Payload);
				const packageName = payloadData.package.name;
				const packageVersion = payloadData.package.version;

				invokeCallback(null, {
					Payload: `{ "fileName": "${packageName}-${packageVersion}.zip" }`
github atom / package-generator / spec / package-generator-spec.js View on Github external
beforeEach(() => {
      spyOn(atom, 'open')

      packageRoot = temp.mkdirSync('atom')
      packageName = 'sweet-package-dude'
      packagePath = path.join(packageRoot, packageName)
      fs.removeSync(packageRoot)
    })
github FreeAllMedia / akiro / es6 / lib / akiro / akiro.js View on Github external
[setDefaults](config) {
		this.role(config.role);
		this.region(config.region);
		this.bucket(config.bucket);

		this.builderDependencies(config.builderDependencies || packageJson.builderDependencies);

		config.libraries = config.libraries || {};

		const temporaryDirectoryPath = config.temporaryDirectoryPath || temp.mkdirSync();
		this.temporaryDirectoryPath(temporaryDirectoryPath);
	}
github FreeAllMedia / akiro / es6 / spec / akiro / akiro.package / akiro.package.someCache.spec.js View on Github external
beforeEach(function (done) {
		this.timeout(10000);

		packageDetails = {
			"async": "1.x.x",
			"incognito": "0.1.4"
		};

		outputDirectoryPath = temp.mkdirSync("akiro.output");
		cacheDirectoryPath = temp.mkdirSync("akiro.cache");

		lambdaConstructorSpy = sinon.spy();
		s3ConstructorSpy = sinon.spy();

		mockAsync = {
			parallel: sinon.spy(Async.parallel)
		};

		mockLambda = {
			invoke: sinon.spy((parameters, invokeCallback) => {
				const payloadData = JSON.parse(parameters.Payload);
				const packageName = payloadData.package.name;
				const packageVersion = payloadData.package.version;

				invokeCallback(null, {