📜  chai 期望对象有键 - 无论代码示例

📅  最后修改于: 2022-03-11 14:59:22.540000             🧑  作者: Mango

代码示例1
// To have all keys
expect({id: 1, name: 'James'}).to.have.all.keys(['id', 'name']);
// To have at least these keys
expect({id: 1, name: 'James'}).to.have.keys(['id', 'name']);
// To have at least one of these keys
expect({id: 1, name: 'James'}).to.have.any.keys(['id', 'name']);