本文整理汇总了TypeScript中chai.assert类的典型用法代码示例。如果您正苦于以下问题:TypeScript assert类的具体用法?TypeScript assert怎么用?TypeScript assert使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了assert类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: setTimeout
setTimeout(() => {
assert.match(printed[0], /error/);
console.error = oldError;
done();
}, 10);
示例2: it
it("does not add the bot user", () => {
const handler = new PresenceHandler(bot as DiscordBot);
handler.EnqueueUser(new MockUser("1234", "def") as any);
Chai.assert.equal(handler.QueueCount, 0);
});
示例3: it
it('match #3: should correctly append custom node into the obfuscated code', () => {
assert.match(obfuscatedCode, consoleWarnRegExp);
});
示例4: it
it("should not do anything if same order given (same object, shallow equality)", ()=>{
const order = "0,1,2,3,4".split(",");
transitionSortConfig({sortConfig:{order}},{sortConfig:{order}}, oncoprint);
assert.equal(oncoprint.setSortConfig.callCount, 0);
});
示例5: it
it('accepts a single argument of the name', () => {
var annotation = new annotations.FieldAnnotation("test");
assert.equal(annotation.name, "test");
assert.isUndefined(annotation.nullable);
});
示例6: it
it("handles no failures", () => {
const result = JSON.parse(formatter.format([]));
assert.deepEqual(result, []);
});
示例7:
}).then((result) => {
assert.deepEqual(result.data, data);
});