本文整理匯總了TypeScript中tmp.dirSync函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript dirSync函數的具體用法?TypeScript dirSync怎麽用?TypeScript dirSync使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了dirSync函數的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: async
async () => {
const tmpDir = tmp.dirSync();
copyDir(path.join(fixturePath, 'element-with-other-deps'), tmpDir.name);
await runCommand(binPath, ['build', '--component-dir=path/to/deps/'], {
cwd: tmpDir.name
});
});
示例2: test
test('handles polymer 2.x project bundler defaults', async () => {
const tmpDir = tmp.dirSync();
copyDir(path.join(fixturePath, 'polymer-2-project', 'source'), tmpDir.name);
await runCommand(binPath, ['build', '--bundle'], {cwd: tmpDir.name});
assertDirsEqual(
path.join(tmpDir.name, 'build/default'),
path.join(fixturePath, 'polymer-2-project', 'expected/default'));
});
示例3: test
test('moduleResolution node rewrites module names to paths', async () => {
const tmpDir = tmp.dirSync();
copyDir(path.join(fixturePath, 'build-modules', 'source'), tmpDir.name);
await runCommand(binPath, ['build'], {cwd: tmpDir.name});
assertDirsEqual(
path.join(tmpDir.name, 'build'),
path.join(fixturePath, 'build-modules', 'expected'));
});
示例4: test
test('module-based project builds with various configs', async () => {
const tmpDir = tmp.dirSync();
copyDir(path.join(fixtureDir, 'build-modules', 'source'), tmpDir.name);
await runCommand(binPath, ['build'], {cwd: tmpDir.name});
assertDirsEqual(
path.join(tmpDir.name, 'build'),
path.join(fixtureDir, 'build-modules', 'expected'));
});
示例5: beforeEach
beforeEach(() => {
base1 = tmp.dirSync()
mkdirp.sync(path.join(base1.name, 'a/b/c/node_modules/hello'))
mkdirp.sync(path.join(base1.name, 'a/b/c/node_production_modules/hello/src'))
fs.writeFileSync(path.join(base1.name, 'a/b/c/index.js'), fileContent('abc index'))
fs.writeFileSync(path.join(base1.name, 'a/b/c.js'), fileContent('c js'))
fs.writeFileSync(path.join(base1.name, 'a/b/c/node_modules/hello/index.js'), fileContent('hello index'))
fs.writeFileSync(path.join(base1.name, 'a/b/c/node_production_modules/hello/package.json'), pkgJson)
fs.writeFileSync(path.join(base1.name, 'a/b/c/node_production_modules/hello/src/main.js'), fileContent('hello pkg'))
})
示例6: suiteSetup
suiteSetup(() => {
chai.should();
tmpDir = tmp.dirSync();
let args: string[] = [];
args.push(path.join("node_modules", "gulp", "bin", "gulp.js"));
args.push("package:offline");
args.push("--retainVsix");// do not delete the existing vsix in the repo
args.push(`-o`);
args.push(tmpDir.name);
invokeNode(args);
vsixFiles = glob.sync(path.join(tmpDir.name, '*.vsix'));
});