本文整理汇总了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'));
});