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


TypeScript mocha-typescript.timeout函數代碼示例

本文整理匯總了TypeScript中mocha-typescript.timeout函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript timeout函數的具體用法?TypeScript timeout怎麽用?TypeScript timeout使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了timeout函數的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: Error

  @test @timeout(10000) async "AutoRest.dll Modeler"() {
    const autoRest = new AutoRest();
    const config = await autoRest.view;
    const dataStore = config.DataStore;

    // load swagger
    const swagger = await LoadLiterateSwagger(
      config,
      dataStore.GetReadThroughScope(),
      "https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2016-12-01/swagger/network.json",
      dataStore.CreateScope("loader"));

    // call modeler
    const autorestPlugin = await GetAutoRestDotNetPlugin();
    const pluginScope = dataStore.CreateScope("plugin");
    const result = await autorestPlugin.Process("modeler", key => { return ({ namespace: "SomeNamespace" } as any)[key]; }, new QuickScope([swagger]), pluginScope, m => null, CancellationToken.None);
    assert.strictEqual(result, true);
    const results = await pluginScope.Enum();
    if (results.length !== 1) {
      throw new Error(`Modeler plugin produced '${results.length}' items. Only expected one (the code model).`);
    }

    // check results
    const codeModel = (await pluginScope.ReadStrict(results[0])).ReadData();
    assert.notEqual(codeModel.indexOf("isPolymorphicDiscriminator"), -1);
  }
開發者ID:amarzavery,項目名稱:AutoRest,代碼行數:26,代碼來源:plugin.ts

示例2: AutoRest

  @test @timeout(10000) async "AutoRest.dll AzureValidator"() {
    const autoRest = new AutoRest();
    const config = await autoRest.view;
    const dataStore = config.DataStore;

    // load swagger
    const swagger = await LoadLiterateSwagger(
      config,
      dataStore.GetReadThroughScope(),
      "https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2016-12-01/swagger/network.json",
      dataStore.CreateScope("loader"));

    // call validator
    const autorestPlugin = await GetAutoRestDotNetPlugin();
    const pluginScope = dataStore.CreateScope("plugin");
    const messages: Message[] = [];
    let currConfig: any = {
      'openapi-type': 'arm',
      'merge-state': 'composed'
    };
    const result = await autorestPlugin.Process("azure-validator", key => currConfig[key], new QuickScope([swagger]), pluginScope, m => messages.push(m), CancellationToken.None);
    assert.strictEqual(result, true);

    // check results
    assert.notEqual(messages.length, 0);
    for (const message of messages) {
      assert.ok(message);
      assert.ok(message.Details.code);
      assert.ok(message.Text);
      assert.ok(message.Details.validationCategory);
      assert.strictEqual(message.Plugin, "azure-validator");
    }
  }
開發者ID:amarzavery,項目名稱:AutoRest,代碼行數:33,代碼來源:plugin.ts

示例3: AutoRest

  @test @timeout(120000) async "network full game"() {
    const autoRest = new AutoRest(new RealFileSystem());
    // PumpMessagesToConsole(autoRest);
    autoRest.AddConfiguration({
      "input-file": [
        "https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2017-03-01/swagger/applicationGateway.json",
        "https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2017-03-01/swagger/checkDnsAvailability.json",
        "https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2017-03-01/swagger/expressRouteCircuit.json",
        "https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2017-03-01/swagger/loadBalancer.json",
        "https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2017-03-01/swagger/network.json",
        "https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2017-03-01/swagger/networkInterface.json",
        "https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2017-03-01/swagger/networkSecurityGroup.json",
        "https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2017-03-01/swagger/networkWatcher.json",
        "https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2017-03-01/swagger/publicIpAddress.json",
        "https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2017-03-01/swagger/routeFilter.json",
        "https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2017-03-01/swagger/routeTable.json",
        "https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2017-03-01/swagger/serviceCommunity.json",
        "https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2017-03-01/swagger/usage.json",
        "https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2017-03-01/swagger/virtualNetwork.json",
        "https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2017-03-01/swagger/virtualNetworkGateway.json",
        "https://github.com/Azure/azure-rest-api-specs/blob/master/arm-network/2017-03-01/swagger/vmssNetworkInterface.json"]
    });

    autoRest.AddConfiguration({
      "override-info": {
        title: "Network"
      }
    });

    // TODO: generate for all, probe results

    const success = await autoRest.Process().finish;
    assert.strictEqual(success, true);
  }
開發者ID:kirthik,項目名稱:autorest,代碼行數:34,代碼來源:end-to-end.ts

示例4: Error

  @test @skip @timeout(10000) async "AutoRest.dll Modeler"() {
    const autoRest = new AutoRest();
    const config = await autoRest.view;
    const dataStore = config.DataStore;

    // load swagger
    const swagger = await LoadLiterateSwagger(
      config,
      dataStore.GetReadThroughScope(new RealFileSystem()),
      "https://github.com/Azure/azure-rest-api-specs/blob/fa91f9109c1e9107bb92027924ec2983b067f5ec/arm-network/2016-12-01/swagger/network.json",
      dataStore.getDataSink());

    // call modeler
    const autorestPlugin = await GetAutoRestDotNetPlugin("modeler");
    const results: DataHandle[] = [];
    const result = await autorestPlugin.Process("modeler", key => { return ({ namespace: "SomeNamespace" } as any)[key]; }, new QuickDataSource([swagger]), dataStore.getDataSink(), f => results.push(f), m => null, CancellationToken.None);
    assert.strictEqual(result, true);
    if (results.length !== 1) {
      throw new Error(`Modeler plugin produced '${results.length}' items. Only expected one (the code model).`);
    }

    // check results
    const codeModel = results[0].ReadData();
    assert.notEqual(codeModel.indexOf("isConstant"), -1);
  }
開發者ID:indrajithbandara,項目名稱:autorest,代碼行數:25,代碼來源:plugin.ts

示例5: SqlDb

    @test @timeout(15000)
    pg_select_batch_2000(done: () => void) {

        let db = new SqlDb();
        db.dbName = "test-pg";
        db.dialect = "pg";

        let sql: string[] = [];

        let total = 2000;
        for (let i = 0; i < total; i++) {
            if (i === 100)
                sql.push("select " + i + " as a777");
            else
                sql.push("select " + i + " as a777");
        }

        db.executeSQL(sql)
            .then((tables: DataTable[]) => {

                for (let i = 0; i < total; i++) {
                    let row = tables[i].rows[0];
                    assert.equal(row["a777"], i);
                }

                done();
            })
            .catch((error) => {
                console.error(error);
                throw error;
            });
    }
開發者ID:KostiaSA,項目名稱:buhta-ClientW,代碼行數:32,代碼來源:WorkLoad2000.test.ts

示例6: AutoRest

 @test @timeout(60000) async "large swagger performance"() {
   const autoRest = new AutoRest(new RealFileSystem(), ResolveUri(CreateFolderUri(__dirname), "resources/large-input/"));
   await autoRest.AddConfiguration({ "output-artifact": ["swagger-document", "swagger-document.map"] });
   const messages: Message[] = [];
   autoRest.Message.Subscribe((_, m) => messages.push(m)); // was warning.
   await autoRest.Process().finish;
   assert.notEqual(messages.length, 0);
 }
開發者ID:jianghaolu,項目名稱:AutoRest,代碼行數:8,代碼來源:blaming.ts

示例7: AutoRest

  @test @timeout(60000) async "other configuration scenario"() {
    const autoRest = new AutoRest(new RealFileSystem(), ResolveUri(CreateFolderUri(__dirname), "../../test/resources/literate-example/readme-complicated.md"));
    // PumpMessagesToConsole(autoRest);


    const config = await autoRest.view;
    assert.strictEqual(config["shouldwork"], true);

  }
開發者ID:indrajithbandara,項目名稱:autorest,代碼行數:9,代碼來源:end-to-end.ts

示例8: compare

  @test @timeout(30000) async "PlainTextVersion"() {
    const compare = (raw: string, expected: string) =>
      assert.strictEqual(PlainTextVersion(this.Parse(raw)), expected);

    compare("Hello World", "Hello World");
    compare("this\ntest\ncould\nuse\nmore\ncowbell", "this test could use more cowbell");
    compare("actual\n\nnewline", "actual\nnewline");
    compare("some **more** delicious *cowbell*", "some more delicious cowbell");
    compare("add some `code` in there", "add some code in there");
    compare("# Heading \n Body", "Heading\nBody");
    compare("Fancy <b>html</b> features", "Fancy html features");
    compare("Even <code>fancier</code> <i>html</i> tags<br> and<hr> stuff", "Even fancier html tags and stuff");
  }
開發者ID:indrajithbandara,項目名稱:autorest,代碼行數:13,代碼來源:commonmark.ts


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