本文整理匯總了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);
});