fs#mkdirSync JavaScript Examples

The following examples show how to use fs#mkdirSync. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: runner.js    From playwright-test with MIT License 6 votes vote down vote up
/**
   *
   * @param {Partial<import('./types').RunnerOptions>} [options]
   */
  constructor(options = {}) {
    /** @type {RunnerOptions} */
    this.options = merge(defaultOptions, options)
    /** @type {import('polka').Polka["server"] | undefined} */
    this.server = undefined

    this.dir = path.join(__dirname, '../.tmp', nanoid())
    mkdirSync(this.dir, {
      recursive: true,
    })
    this.browserDir = temporaryDirectory()
    this.url = ''
    this.stopped = false
    this.watching = false
    this.env = merge(JSON.parse(JSON.stringify(process.env)), {
      PW_TEST: this.options,
    })
    this.extensions = this.options.extensions.split(',')
    this.beforeTestsOutput = undefined
    this.tests = findTests({
      cwd: this.options.cwd,
      extensions: this.extensions,
      filePatterns: this.options.input
        ? this.options.input
        : defaultTestPatterns(this.extensions),
    })
    if (this.tests.length === 0) {
      this.stop(false, 'No test files were found.')
    }

    process.env.DEBUG += ',-pw:*'
  }
Example #2
Source File: filesystem.spec.js    From kit with MIT License 5 votes vote down vote up
suite_copy.before.each(() => {
	const temp_dir = mkdtempSync(join(tmpdir(), 'kit-core-filesystem-'));
	source_dir = join(temp_dir, 'source');
	dest_dir = join(temp_dir, 'dest');
	mkdirSync(source_dir);
	mkdirSync(dest_dir);
});