本文整理汇总了TypeScript中chai.assert.deepInclude方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.deepInclude方法的具体用法?TypeScript assert.deepInclude怎么用?TypeScript assert.deepInclude使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chai.assert
的用法示例。
在下文中一共展示了assert.deepInclude方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("returns a list of the children", function() {
const usEast: LocalityTree = {
tiers: [{ key: "region", value: "us-east" }],
localities: {},
nodes: [],
};
const usWest: LocalityTree = {
tiers: [{ key: "region", value: "us-west" }],
localities: {},
nodes: [],
};
const locality: LocalityTree = {
tiers: [],
localities: {
region: {
"us-east": usEast,
"us-west": usWest,
},
},
nodes: [],
};
const children = getChildLocalities(locality);
assert.lengthOf(children, 2);
assert.deepInclude(children, usEast);
assert.deepInclude(children, usWest);
});
示例2: test
test('finds properties', async () => {
const cls = (await getScannedClasses('class/class-properties.js'))[0];
assert.deepInclude(cls.properties.get('customPropertyGetterType'), {
name: 'customPropertyGetterType',
type: 'boolean',
description: 'A boolean getter',
readOnly: true
});
assert.deepInclude(cls.properties.get('customPropertyWithGetterSetter'), {
name: 'customPropertyWithGetterSetter',
description: 'a property with a getter/setter',
readOnly: false
});
assert.deepInclude(
cls.properties.get('customPropertyWithReadOnlyGetter'),
{name: 'customPropertyWithReadOnlyGetter', readOnly: true});
assert.deepInclude(
cls.properties.get('customPropertyOnProto'),
{name: 'customPropertyOnProto', type: 'string'});
assert.deepInclude(
cls.properties.get('customPropertyOnProtoValue'),
{name: 'customPropertyOnProtoValue', type: 'number'});
assert.deepInclude(cls.properties.get('customPropertyOnProtoDoc'), {
name: 'customPropertyOnProtoDoc',
description: 'A property',
type: '(boolean | number)',
privacy: 'private',
readOnly: true
});
assert.deepInclude(
cls.properties.get('__customPropertyOnProtoPrivate'),
{name: '__customPropertyOnProtoPrivate', privacy: 'private'});
assert.deepEqual(await getTestProps(cls), {
name: 'Class',
constructorMethod: {description: '', name: 'constructor'},
description: '',
privacy: 'public',
properties: [
{name: 'customPropertyWithValue'},
{name: 'customPropertyWithJSDoc'},
{name: 'customPropertyGetter'},
{name: 'customPropertyGetterType'},
{name: 'customPropertyWithGetterSetter'},
{name: 'customPropertyWithSetterFirst'},
{name: 'customPropertyWithReadOnlyGetter'},
{name: 'customPropertyOnProto'},
{name: 'customPropertyOnProtoValue'},
{name: 'customPropertyOnProtoDoc'},
{name: '__customPropertyOnProtoPrivate'}
]
});
});