本文整理汇总了TypeScript中chai.assert.deepEqual方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.deepEqual方法的具体用法?TypeScript assert.deepEqual怎么用?TypeScript assert.deepEqual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类chai.assert
的用法示例。
在下文中一共展示了assert.deepEqual方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: test
test('scans properties', async () => {
const namespaces = await getNamespaces('namespace-properties.js');
assert.equal(namespaces.length, 1);
assert.equal(namespaces[0].name, 'PropertiesNamespace');
assert.equal(namespaces[0].description, '');
assert.deepEqual(namespaces[0].warnings, []);
assert.deepEqual(getProperties(namespaces[0]), [
{
name: 'property',
description: undefined,
privacy: 'public',
readOnly: false,
type: 'string',
warnings: []
},
{
name: 'propertyWithAnnotation',
description: 'Property with annotation',
privacy: 'public',
readOnly: false,
type: '(string | number)',
warnings: []
},
{
name: 'propertyWithReadOnly',
description: undefined,
privacy: 'public',
readOnly: true,
type: 'string',
warnings: []
},
{
name: 'propertyWithGetter',
description: undefined,
privacy: 'public',
readOnly: true,
type: undefined,
warnings: []
},
{
name: 'propertyWithGetterSetter',
description: undefined,
privacy: 'public',
readOnly: false,
type: undefined,
warnings: []
},
{
name: 'propertyWithSetterFirst',
description: undefined,
privacy: 'public',
readOnly: false,
type: undefined,
warnings: []
},
{
name: 'propertyDefinedLater',
description: undefined,
privacy: 'public',
readOnly: false,
type: 'string',
warnings: []
},
{
name: 'propertyDefinedLaterWithAnnotation',
description: 'Test property',
privacy: 'public',
readOnly: false,
type: 'boolean',
warnings: []
},
{
name: 'propertyDefinedLaterWithoutValue',
description: undefined,
privacy: 'public',
readOnly: false,
type: 'string',
warnings: []
}
]);
});
示例2: assertElements
return helpers.executeActionByChunks(initialData, chunkSize, (element: number, index: number) => {
handledElements.push(element);
assert.deepEqual(element, initialData[index]);
assert.isTrue(initialData.indexOf(element) !== -1);
return assertElements(initialData, handledElements, element, chunkSize);
});
示例3: it
it('should center on y', function() {
assert.deepEqual(props.y, { value: 10.5 });
});
示例4:
const assertPidTestData = (testData: IiOSSimulatorPidTestData) => {
const actualResult = helpers.getPidFromiOSSimulatorLogs(testData.appId || appId, testData.input);
assert.deepEqual(actualResult, testData.expectedResult, `For input ${testData.input}, the expected result is: ${testData.expectedResult}, but actual result is: ${actualResult}.`);
};
示例5: it
it("returns false when Object.create(null) is passed", () => {
const actualResult = helpers.toBoolean(Object.create(null));
assert.deepEqual(actualResult, false);
});
示例6: it
it('should correctly parse an encoding query given a fieldDefShorthand with timeunit function', () => {
const encQ = shorthandParser.fn('hours(a,t)');
assert.deepEqual(encQ, {field: 'a', timeUnit: TimeUnit.HOURS, type: Type.TEMPORAL});
});