当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript assert.isAtMost方法代码示例

本文整理汇总了TypeScript中chai.assert.isAtMost方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.isAtMost方法的具体用法?TypeScript assert.isAtMost怎么用?TypeScript assert.isAtMost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在chai.assert的用法示例。


在下文中一共展示了assert.isAtMost方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: onRuntimeSendMessageCalled

 aFromRuntime.sendMessage.callsFake((aMessage) => {
   const {_listeners} = aToRuntime.onMessage;
   assert.isAtMost(_listeners.length, 1);
   if (_listeners.length === 0) return Promise.resolve();
   const rv = Promise.resolve(_listeners[0](aMessage));
   if (onRuntimeSendMessageCalled) {
     onRuntimeSendMessageCalled(aMessage, rv);
   }
   return rv;
 });
开发者ID:RequestPolicyContinued,项目名称:requestpolicy,代码行数:10,代码来源:test-storage-migration-between-xpcom-and-we.ts

示例2: filteredCustomers1

 @test('filter="fre" returns subset of results')
 public async filteredCustomers1() {
   let result = await getAllCustomers({ filter: 'fre' });
   assert.isArray(result, 'Expected result to be an array');
   assert.isAtLeast(result.length, 3, 'Expected 3 or more customers in array');
   assert.isAtMost(result.length, 5, 'Expected 5 or fewer customers in array');
   validateRecordColumns(
     {
       recordType: 'customer',
       functionName: 'getAllCustomers({ filter: "fre" })'
     },
     result[0],
     ALL_CUSTOMERS_REQUIRED_COLS,
     []
   );
 }
开发者ID:qjac,项目名称:sql-fundamentals,代码行数:16,代码来源:ex02.filtering-cutomers.test.ts

示例3:

      fetchMock.mock("/ts/query", "post", (url: string, requestObj: RequestInit) => {
          // Assert that metric store's "inFlight" is 1 or 2.
          assert.isAtLeast(mockMetricsState.inFlight, 1);
          assert.isAtMost(mockMetricsState.inFlight, 1);

          let request = JSON.parse(requestObj.body as string) as TSRequest;
          return {
            body: {
              results: _.map(request.queries, (q) => {
                return {
                  query: q,
                  datapoints: [],
                };
              }),
            },
          };
      });
开发者ID:WillHaack,项目名称:cockroach,代码行数:17,代码来源:metrics.spec.ts

示例4:

        response: (url: string, requestObj: RequestInit) => {
          // Assert that metric store's "inFlight" is 1 or 2.
          assert.isAtLeast(mockMetricsState.inFlight, 1);
          assert.isAtMost(mockMetricsState.inFlight, 2);

          let request = protos.cockroach.ts.tspb.TimeSeriesQueryRequest.decode(requestObj.body as ArrayBuffer);

          return {
            body: new protos.cockroach.ts.tspb.TimeSeriesQueryResponse({
              results: _.map(request.queries, (q) => {
                return {
                  query: q,
                  datapoints: [],
                };
              }),
            }).toArrayBuffer(),
          };
        },
开发者ID:martinpinto,项目名称:cockroach,代码行数:18,代码来源:metrics.spec.ts

示例5:

      fetchMock.mock("/ts/query", "post", (url: string, requestObj: RequestInit) => {
          // Assert that metric store's "inFlight" is 1 or 2.
          assert.isAtLeast(mockMetricsState.inFlight, 1);
          assert.isAtMost(mockMetricsState.inFlight, 1);

          let request = new protos.cockroach.ts.tspb.TimeSeriesQueryRequest(JSON.parse(requestObj.body as string));

          return {
            sendAsJson: false,
            body: new protos.cockroach.ts.tspb.TimeSeriesQueryResponse({
              results: _.map(request.queries, (q) => {
                return {
                  query: q,
                  datapoints: [],
                };
              }),
            }).encodeJSON(),
          };
      });
开发者ID:codepope,项目名称:cockroach,代码行数:19,代码来源:metrics.spec.ts

示例6: filteredCustomers2

 @test('filter="mo" returns subset of results')
 public async filteredCustomers2() {
   let result = await getAllCustomers({ filter: 'mo' });
   assert.isArray(result, 'Expected result to be an array');
   assert.isAtMost(
     result.length,
     12,
     'Expected 12 or fewer customers in array'
   );
   validateRecordColumns(
     {
       recordType: 'customer',
       functionName: 'getAllCustomers({ filter: "mo" })'
     },
     result[1],
     ALL_CUSTOMERS_REQUIRED_COLS,
     []
   );
 }
开发者ID:qjac,项目名称:sql-fundamentals,代码行数:19,代码来源:ex02.filtering-cutomers.test.ts


注:本文中的chai.assert.isAtMost方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。