mirror of https://github.com/lukechilds/node.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
639 B
23 lines
639 B
'use strict';
|
|
const common = require('../common');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
// make a path that is more than 260 chars long.
|
|
const dirNameLen = Math.max(260 - common.tmpDir.length, 1);
|
|
const dirName = path.join(common.tmpDir, 'x'.repeat(dirNameLen));
|
|
const fullDirPath = path.resolve(dirName);
|
|
|
|
const indexFile = path.join(fullDirPath, 'index.js');
|
|
const otherFile = path.join(fullDirPath, 'other.js');
|
|
|
|
common.refreshTmpDir();
|
|
|
|
fs.mkdirSync(fullDirPath);
|
|
fs.writeFileSync(indexFile, 'require("./other");');
|
|
fs.writeFileSync(otherFile, '');
|
|
|
|
require(indexFile);
|
|
require(otherFile);
|
|
|
|
common.refreshTmpDir();
|
|
|