本文整理汇总了TypeScript中test/helper.assert.deepEqual方法的典型用法代码示例。如果您正苦于以下问题:TypeScript assert.deepEqual方法的具体用法?TypeScript assert.deepEqual怎么用?TypeScript assert.deepEqual使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类test/helper.assert
的用法示例。
在下文中一共展示了assert.deepEqual方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it('works', function() {
assert(domElement instanceof HTMLElement, 'creates an HTMLElement');
assert.equal(domElement.tagName, 'SOME-COMPONENT', 'the element has the appropriate tag name');
assert.deepEqual(domElement.style.color, 'green', 'the element gets the passed in style attributes');
assert.deepEqual(domElement.getAttribute('widget-name'), 'SpecialWidget',
'the element gets the passed in attributes');
});
示例2: it
it('works', function() {
document.body.appendChild(sandbox);
var personTypeField = sandbox.querySelector('fieldset>labeled-select-field');
assert.equal(getLabel(personTypeField), 'Gen persoană', 'has the appropriate label');
assert.equal(getDOMValue(personTypeField), PersonSection.PERSON_TYPES.INDIVIDUAL, 'has the default value of “fizică”');
var optionTexts = getOptionTexts(personTypeField.querySelector('select'));
assert.equal(optionTexts.length, PersonSection.PERSON_TYPES.length, 'has the appropriate number of options');
assert.deepEqual(optionTexts, PersonSection.PERSON_TYPES, 'has PERSON as the first option');
setPersonType(PersonSection.PERSON_TYPES.COMPANY);
var expectedFieldLabelTexts = ['Gen persoană', 'Denumire', 'IDNO', 'Sediu', 'Persoană de contact', 'Note'];
assert.deepEqual(getLabelTexts(), expectedFieldLabelTexts, 'changes the fields appropriately');
var nextFieldInput = getInputOfFieldBelowPersonTypeField(sandbox);
assert.equal(document.activeElement, nextFieldInput, 'focuses the first field');
document.body.removeChild(sandbox);
function setPersonType(personType) {
var select = personTypeField.querySelector('select');
select.value = personType;
select.dispatchEvent(new Event('change'));
}
});
示例3: it
it('works', function() {
optionButton1.click();
optionButton1.click();
assert.deepEqual(optionHandler1.calls.length, 2, 'clicking on an option calls its corresponding handler');
optionButton2.click();
assert.deepEqual(optionHandler2.calls.length, 1, 'clicking on an option calls its corresponding handler');
});
示例4: it
it('reacts to clicks', function() {
optionButtons[0].click();
assert.deepEqual(activityAdder.calls[0].args, [activities[0]],
'calls the activityAdder with the corresponding activity');
assert.equal(activityAdder.calls.length, 1, 'clicking an option calls the activityAdder once');
assert.deepEqual(addActivityButton.getActivities(), InstitutionActivity.NEXT_ACTIVITY_OPTIONS,
'updates option list based on the selected option’s NEXT_ACTIVITY_OPTIONS');
});
示例5: it
it('works for arrays', function() {
assert.deepEqual(
rMap('toString', [42, 'A', true]),
['42', 'A', 'true'],
'returns an array containing the results of the given method call applied to each member'
);
});
示例6: it
it('works', function() {
var hash = {
K1: 'v1',
K2: 'v2',
K3: 'v3'
};
var ENUM = createEnumArray(hash);
assert(ENUM instanceof Array, 'returns an array');
assert.deepEqual(ENUM, _.values(hash), 'the returned array contains values from the given hash');
assert.equal(ENUM.K1, 'v1', 'the array gets properties as per hash');
assert.equal(ENUM.K2, 'v2', 'the array gets properties as per hash');
assert.equal(ENUM.K3, 'v3', 'the array gets properties as per hash');
assert.deepEqual(Object.keys(ENUM), ['0', '1', '2'], 'the additional properties are not enumerable');
});
示例7: it
it('has the appropriate DOM structure', function() {
var labelText = dropdownButton.querySelector('button').textContent;
assert.equal(labelText, 'adaugă persoană', 'has the appropriate label');
actionButtons = _.toArray(dropdownButton.querySelectorAll('option-list>button'));
var actionButtonLablels = actionButtons.map(_.property('textContent'));
assert.deepEqual(actionButtonLablels, ['debitor', 'persoană terţă'], 'options have the appropriate labels');
});
示例8: it
it('tells the next activity options', function() {
//
// TODO: determine the options later.
//
assert.deepEqual(InstitutionActivity.NEXT_ACTIVITY_OPTIONS,
[], 'are exposed');
});
示例9: it
it('works with an array of fields', function() {
getValue = getFieldValueCollector([field1, field2]);
assert.deepEqual(getValue(), {
'name': 'John Doe',
'date-of-birth': '01.01.1970'
}, 'the returned function returns the values of the fields keyed by their internalName');
});
示例10: it
it('can be asked to setValue', function() {
var newValue = {
'is-completed': true
};
activityStep.setValue(newValue);
assert.deepEqual(activityStep.getValue()['is-completed'], newValue['is-completed']);
});