本文整理汇总了TypeScript中glob-promise.sync函数的典型用法代码示例。如果您正苦于以下问题:TypeScript sync函数的具体用法?TypeScript sync怎么用?TypeScript sync使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了sync函数的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: 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'));
});
示例2: loadFiles
function loadFiles(projectRoot: string, modelsDir: string): string[] {
// this should be in options
return glob.sync(path.resolve(projectRoot, modelsDir));
}
示例3: loadRepoFiles
function loadRepoFiles(projectRoot: string): string[] {
// this should be in options
return glob.sync(projectRoot + '/repositories/*.repository.js');
}
示例4: suite
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import * as chai from 'chai';
import * as fs from 'async-file';
import * as glob from 'glob-promise';
import * as path from 'path';
let vsixFiles = glob.sync(path.join(process.cwd(), '**', '*.vsix'));
suite("Omnisharp-Vscode VSIX", async () => {
suiteSetup(async () => {
chai.should();
});
test("At least one vsix file should be produced", () => {
vsixFiles.length.should.be.greaterThan(0, "the build should produce at least one vsix file");
});
vsixFiles.forEach(element => {
const sizeInMB = 5;
const maximumVsixSizeInBytes = sizeInMB * 1024 * 1024;
suite(`Given ${element}`, () => {
test(`Then its size is less than ${sizeInMB}MB`, async () => {
const stats = await fs.stat(element);
stats.size.should.be.lessThan(maximumVsixSizeInBytes);
});