本文整理匯總了TypeScript中tests/utility.Utility類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Utility類的具體用法?TypeScript Utility怎麽用?TypeScript Utility使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Utility類的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: it
it("should create a Page Break with correct attributes", () => {
const newJson = Utility.jsonify(pageBreak);
const attributes = {
type: "page",
};
assert.equal(JSON.stringify(newJson.root[1].root[0].root), JSON.stringify(attributes));
});
示例2: it
it("should create a bookmark with the correct attributes on the bookmark end element", () => {
const newJson = Utility.jsonify(bookmark);
const attributes = {
id: "1",
};
assert.equal(JSON.stringify(newJson.end.root[0].root), JSON.stringify(attributes));
});
示例3: it
it("should create a Super Script with correct attributes", () => {
const newJson = Utility.jsonify(superScript);
const attributes = {
val: "superscript",
};
assert.equal(JSON.stringify(newJson.root[0].root), JSON.stringify(attributes));
});
示例4: it
it("should create a element with correct root key", () => {
const newJson = Utility.jsonify(new SimplePos());
assert.equal(newJson.rootKey, "wp:simplePos");
assert.include(newJson.root[0].root, {
x: 0,
y: 0,
});
});
示例5: it
it("should create a Tab Stop with correct attributes", () => {
const newJson = Utility.jsonify(tabStop);
const attributes = {
val: "left",
pos: 100,
};
assert.equal(JSON.stringify(newJson.root[0].root[0].root), JSON.stringify(attributes));
});
示例6: it
it("should create a hyperlink with right attributes", () => {
const newJson = Utility.jsonify(hyperlink);
const attributes = {
history: 1,
id: "rId1",
};
assert.equal(JSON.stringify(newJson.root[0].root), JSON.stringify(attributes));
});
示例7: it
it("should create a Thematic Break with correct border properties", () => {
const newJson = Utility.jsonify(thematicBreak);
const attributes = {
color: "auto",
space: "1",
val: "single",
sz: "6",
};
assert.equal(JSON.stringify(newJson.root[0].root[0].root), JSON.stringify(attributes));
});
示例8: it
it("should create a drawing with anchor element when there options are passed", () => {
currentBreak = createDrawing({
floating: {
horizontalPosition: {
offset: 0,
},
verticalPosition: {
offset: 0,
},
},
});
const newJson = Utility.jsonify(currentBreak);
assert.equal(newJson.root[0].rootKey, "wp:anchor");
});