當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript glob-promise.sync函數代碼示例

本文整理匯總了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'));
 });
開發者ID:peterblazejewicz,項目名稱:omnisharp-vscode,代碼行數:12,代碼來源:offlinePackage.test.ts

示例2: loadFiles

function loadFiles(projectRoot: string, modelsDir: string): string[] {
  // this should be in options
  return glob.sync(path.resolve(projectRoot, modelsDir));
}
開發者ID:xanthous-tech,項目名稱:loopback-4-typeorm,代碼行數:4,代碼來源:repository-booter.mixin.ts

示例3: loadRepoFiles

function loadRepoFiles(projectRoot: string): string[] {
  // this should be in options
  return glob.sync(projectRoot + '/repositories/*.repository.js');
}
開發者ID:xanthous-tech,項目名稱:loopback-4-typeorm,代碼行數:4,代碼來源:repository-booter.mixin.ts

示例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);
            });
開發者ID:eamodio,項目名稱:omnisharp-vscode,代碼行數:31,代碼來源:vsix.test.ts


注:本文中的glob-promise.sync函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。