當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。