本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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'
);
}
示例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);
}
示例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);
}
示例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'
);
}
示例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"]);
});
示例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);
}
示例10: orderSubtotalPresent
@test('getOrder() results must now include subtotal')
public async orderSubtotalPresent() {
let orderResult = await getOrder(10248);
assert.containsAllKeys(orderResult, ['subtotal']);
}