本文整理匯總了TypeScript中@ephox/agar.Assertions.assertEq方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript Assertions.assertEq方法的具體用法?TypeScript Assertions.assertEq怎麽用?TypeScript Assertions.assertEq使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@ephox/agar.Assertions
的用法示例。
在下文中一共展示了Assertions.assertEq方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1:
const sTestHasStrongRtl = Step.sync(function () {
Assertions.assertEq('Hebrew is strong rtl', true, Bidi.hasStrongRtl('\u05D4\u05E7\u05D3\u05E9'));
Assertions.assertEq('Abc is not strong rtl', false, Bidi.hasStrongRtl('abc'));
Assertions.assertEq('Dots are neutral', false, Bidi.hasStrongRtl('.'));
});
示例2:
return Step.sync(function () {
const rng = editor.selection.getRng();
const sc = rng.startContainer, so = rng.startOffset;
const chr = sc.data.substr(so - 1, 1);
Assertions.assertEq('Should be after a zwsp at caret', chr, Zwsp.ZWSP);
});
示例3:
return Step.sync(function () {
Assertions.assertEq('Should have the right caret data', expectedCaretData, editor.selection.getNode().getAttribute('data-mce-caret'));
});
示例4:
return Step.sync(function () {
Assertions.assertEq('checking normalization counter', expected, count);
});
示例5: function
Arr.each(textCases, function (c) {
Assertions.assertEq(c.label || 'Asserting: ' + c.content, c.isText, Newlines.isPlainText(c.content));
});
示例6: function
const assertRange = function (expected, actual) {
Assertions.assertEq('startContainers should be equal', true, expected.startContainer === actual.startContainer);
Assertions.assertEq('startOffset should be equal', true, expected.startOffset === actual.startOffset);
Assertions.assertEq('endContainer should be equal', true, expected.endContainer === actual.endContainer);
Assertions.assertEq('endOffset should be equal', true, expected.endOffset === actual.endOffset);
};
示例7:
Chain.op((element) => {
Assertions.assertEq(`The input value for ${Label} should be: `, expected, Value.get(element));
})
示例8:
return Chain.op(function (linebreak: LineInfo) {
const actualBreakType = linebreak.breakType;
Assertions.assertEq('Should be the expected break type', expectedBreakType, actualBreakType);
});
示例9:
return Step.sync(function () {
const result = editor[name]();
Assertions.assertEq('Should be expected value on a removed editor', expectedValue, result);
});