How to use the tmp-promise.tmpNameSync function in tmp-promise

To help you get started, we’ve selected a few tmp-promise 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 Unity-Technologies / unity-cache-server / test / unity_cache_server.js View on Github external
before(async () => {
            UnityCacheServer.constructor._cache_instance = null;
            const tmpPath = tmp.tmpNameSync();

            process.env.NODE_CONFIG = JSON.stringify({
                Server: {
                        port: 0
                    },
                Cache: {
                    defaultModule: "cache_fs",
                    options: {
                        workers: 1, // test to ensure clustering is disabled automatically
                        cache_fs: {
                            cachePath: tmpPath
                        }
                    }
                },
                Diagnostics: {
                    clientRecorder: true,
github electron-userland / electron-installer-redhat / test / helpers / describe_installer.js View on Github external
tempOutputDir: function tempOutputDir (customDir) {
    return customDir ? path.join(os.tmpdir(), customDir) : tmp.tmpNameSync({ prefix: 'electron-installer-redhat-' })
  },
github electron-userland / electron-installer-windows / test / helpers / describe_installer.js View on Github external
function installerOptions (asar, testOptions) {
  const options = {}

  const appName = asar ? 'footest' : 'bartest'

  options.src = asar ? 'test/fixtures/app-with-asar/' : 'test/fixtures/app-without-asar/'
  options.dest = tmp.tmpNameSync({ prefix: 'electron-installer-windows-' })
  options.options = testOptions
  options.rename = (dest, src) => {
    const ext = path.extname(src)
    if (ext === '.exe' || ext === '.msi') {
      src = `<%= name %>-<%= version %>-installer${ext}`
    }
    return path.join(dest, src)
  }

  return [appName, options]
}
github Unity-Technologies / unity-cache-server / test / reliability_manager.js View on Github external
before(() => {
        const tmpDir = tmp.tmpNameSync();
        db = new loki('test.db');
        rm = new ReliabilityManager(db, tmpDir, {reliabilityThreshold: 2, saveUnreliableVersionArtifacts: true});
    });
github Unity-Technologies / unity-cache-server / test / unity_cache_server.js View on Github external
before(() => {
            UnityCacheServer.constructor._cache_instance = null;
            this._tmpPath = tmp.tmpNameSync();

            this._cacheOpts = {
                test: true,
                persistenceOptions: {
                    autosave: false
                }
            };

            process.env.NODE_CONFIG = JSON.stringify({
                Cache: {
                    defaultModule: "cache_fs",
                    options: { cache_fs: { cachePath: this._tmpPath } }
                }
            });
        });
github electron-userland / electron-installer-windows / test / helpers / describe_cli.js View on Github external
module.exports = function (desc, asar, options) {
  let appName
  asar ? appName = 'footest' : appName = 'bartest'

  if (!options) options = {}
  asar ? options.src = 'test/fixtures/app-with-asar/' : options.src = 'test/fixtures/app-without-asar/'

  options.dest = tmp.tmpNameSync({ prefix: 'electron-installer-windows-' })

  const args = ['--src', options.src, '--dest', options.dest]

  if (options.certificateFile && options.certificatePassword) {
    args.push('--certificateFile', options.certificateFile)
    args.push('--certificatePassword', options.certificatePassword)
  }
  if (options.remoteReleases) args.push('--remoteReleases', options.remoteReleases)

  describe(desc, test => {
    before(async () => {
      const logs = await spawn('./src/cli.js', args, null, null)
      printLogs(logs)
    })

    after(async () => fs.remove(options.dest))
github electron-userland / electron-installer-debian / test / helpers / describe_installer.js View on Github external
module.exports.tempOutputDir = function tempOutputDir (customDir) {
  return customDir ? path.join(os.tmpdir(), customDir) : tmp.tmpNameSync({ prefix: 'electron-installer-debian-' })
}
github Unity-Technologies / unity-cache-server / test / cache_api.js View on Github external
options: {
            cachePath: tmp.tmpNameSync({}),
            pageSize: 1024 * 1024,
            minFreeBlockSize: 1024,
            persistenceOptions: {
                autosave: false,
                adapter: new loki.LokiMemoryAdapter()
            },
            highReliability: false
        }
    },
    {
        name: "cache_fs",
        path: "../lib/cache/cache_fs",
        options: {
            cachePath: tmp.tmpNameSync({}),
            highReliability: false,
            persistenceOptions: {
                autosave: false
            }
        }
    }
];

describe("Cache API", function() {
    this.slow(300);

    test_modules.forEach(module => {
        describe(module.name, () => {
            let CacheModule, cache;

            before(() => {

tmp-promise

The tmp package with promises support and disposers.

MIT
Latest version published 3 years ago

Package Health Score

73 / 100
Full package analysis