当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript assert.deepEqual方法代码示例

本文整理汇总了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');
 });
开发者ID:gurdiga,项目名称:xo,代码行数:7,代码来源:createDOMElementTest.ts

示例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'));
      }
    });
开发者ID:gurdiga,项目名称:xo,代码行数:26,代码来源:PersonSectionTest.ts

示例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');
  });
开发者ID:gurdiga,项目名称:xo,代码行数:8,代码来源:OptionListTest.ts

示例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');
  });
开发者ID:gurdiga,项目名称:xo,代码行数:9,代码来源:AddActivityButtonTest.ts

示例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'
   );
 });
开发者ID:gurdiga,项目名称:xo,代码行数:7,代码来源:rMapTest.ts

示例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');
  });
开发者ID:gurdiga,项目名称:xo,代码行数:17,代码来源:createEnumArrayTest.ts

示例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');
    });
开发者ID:gurdiga,项目名称:xo,代码行数:8,代码来源:NewCaseDialogTest.ts

示例8: it

  it('tells the next activity options', function() {
    //
    // TODO: determine the options later.
    //

    assert.deepEqual(InstitutionActivity.NEXT_ACTIVITY_OPTIONS,
      [], 'are exposed');
  });
开发者ID:gurdiga,项目名称:xo,代码行数:8,代码来源:InstitutionActivityTest.ts

示例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');
  });
开发者ID:gurdiga,项目名称:xo,代码行数:8,代码来源:getFieldValueCollectorTest.ts

示例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']);
  });
开发者ID:gurdiga,项目名称:xo,代码行数:8,代码来源:ActivityStepTest.ts


注:本文中的test/helper.assert.deepEqual方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。