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


TypeScript assert.containsAllKeys方法代码示例

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


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

示例1: getOrderColumnTest

 @test('getOrder() result must now include customername and employeename columns')
 public async getOrderColumnTest() {
   let firstPageResult = await getOrder(10300);
   assert.containsAllKeys(firstPageResult, ['customername', 'employeename']);
   assert.ok((firstPageResult as any).customername);
   assert.ok((firstPageResult as any).employeename);
 }
开发者ID:qjac,项目名称:sql-fundamentals,代码行数:7,代码来源:ex04.order-detail-join.test.ts

示例2: allOrdersColumnTest

 @test('getAllOrders() results must now include customername and employeename columns')
 public async allOrdersColumnTest() {
   let firstPageResult = await getAllOrders();
   assert.containsAllKeys(firstPageResult[0], ['customername', 'employeename']);
   assert.ok((firstPageResult[0] as any).customername);
   assert.ok((firstPageResult[0] as any).employeename);
 }
开发者ID:qjac,项目名称:sql-fundamentals,代码行数:7,代码来源:ex04.order-list-join.test.ts

示例3: orderListDesc

  @test('using order="desc" (and specifying no column to sort on) sorts decending by shippeddate')
  public async orderListDesc() {
    let firstPageResult = await getCustomerOrders('ANTON', {
      perPage: 3,
      order: 'desc'
    });
    assert.containsAllKeys(firstPageResult[0], ['shippeddate']);

    let sortedById = orderBy(firstPageResult, 'shippeddate', 'desc');
    assert.deepEqual(firstPageResult, sortedById);
  }
开发者ID:qjac,项目名称:sql-fundamentals,代码行数:11,代码来源:ex03.sort-customer-orders.test.ts

示例4: mySQLGeneratedColumnsPresent

 @test('[MYSQL ONLY] Generated columns for flavors are found on product table')
 @onlyForDatabaseTypes(DbType.MySQL)
 public async mySQLGeneratedColumnsPresent() {
   let db = await getDb();
   let p = await db.get(sql`SELECT * from Product WHERE id=1`);
   assert.containsAllKeys(
     p,
     ['spicy', 'sweet', 'sour', 'salty', 'bitter'],
     'salty, sweet, sour, spicy and bitter columns are present on Product table'
   );
 }
开发者ID:qjac,项目名称:sql-fundamentals,代码行数:11,代码来源:ex14.migration.test.ts

示例5: allProductsColumnTest

 @test(
   'getAllProducts() results must now include categoryname and suppliername columns'
 )
 public async allProductsColumnTest() {
   let firstPageResult = await getAllProducts();
   assert.containsAllKeys(firstPageResult[0], [
     'suppliername',
     'categoryname'
   ]);
   assert.ok((firstPageResult[0] as any).suppliername);
   assert.ok((firstPageResult[0] as any).categoryname);
 }
开发者ID:qjac,项目名称:sql-fundamentals,代码行数:12,代码来源:ex04.products-join.test.ts

示例6: reorderableProductsColumnTest

 @test(
   'getAllProducts({ filter: { inventory: "needs-reorder" } }) results must now include categoryname and suppliername columns'
 )
 public async reorderableProductsColumnTest() {
   let firstPageResult = await getAllProducts({
     filter: { inventory: 'needs-reorder' }
   });
   assert.containsAllKeys(firstPageResult[0], [
     'suppliername',
     'categoryname'
   ]);
   assert.ok((firstPageResult[0] as any).suppliername);
   assert.ok((firstPageResult[0] as any).categoryname);
 }
开发者ID:qjac,项目名称:sql-fundamentals,代码行数:14,代码来源:ex04.products-join.test.ts

示例7: assertProductCols

function assertProductCols(item: any) {
  assert.containsAllKeys(
    item,
    [
      'id',
      'categoryid',
      'discontinued',
      'productname',
      'quantityperunit',
      'reorderlevel',
      'supplierid',
      'unitprice',
      'unitsinstock',
      'unitsonorder'
    ], // tslint:disable-next-line:max-line-length
    'each DB result has properties id, categoryid, discontinued, productname, quantityperunit, reorderlevel, supplierid, unitprice, unitsinstock, unitsonorder'
  );
}
开发者ID:qjac,项目名称:sql-fundamentals,代码行数:18,代码来源:ex02.filtering-products.test.ts

示例8: it

  it("should call with current continuation with additional arguments", async () => {
    const context = new MetaesContext(undefined, undefined, {
      values: { callWithCurrentContinuation, receiver }
    });

    let env;
    function receiver(_, cc, _cerr, environment) {
      // remember environment for later check
      env = environment;
      // intentionally continue a bit later
      setTimeout(cc, 0, 21);
    }

    const result = await evalFunctionBodyAsPromise({
      context,
      source: callWithCurrentContinuation => 2 * callWithCurrentContinuation(receiver)
    });
    assert.equal(result, 42);
    assert.containsAllKeys(env, ["values"]);
  });
开发者ID:metaes,项目名称:metaes,代码行数:20,代码来源:callcc.spec.ts

示例9: getOrderDetailsColumnTest

 @test('getOrderDetails() result must now include productname column')
 public async getOrderDetailsColumnTest() {
   let firstPageResult = await getOrderDetails(10300);
   assert.containsAllKeys(firstPageResult[0], ['productname']);
   assert.ok((firstPageResult[0] as any).productname);
 }
开发者ID:qjac,项目名称:sql-fundamentals,代码行数:6,代码来源:ex04.order-detail-join.test.ts

示例10: orderSubtotalPresent

 @test('getOrder() results must now include subtotal')
 public async orderSubtotalPresent() {
   let orderResult = await getOrder(10248);
   assert.containsAllKeys(orderResult, ['subtotal']);
 }
开发者ID:qjac,项目名称:sql-fundamentals,代码行数:5,代码来源:ex05.order-subtotal.test.ts


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