本文整理汇总了TypeScript中Sinon.SinonSpy.calledWith方法的典型用法代码示例。如果您正苦于以下问题:TypeScript SinonSpy.calledWith方法的具体用法?TypeScript SinonSpy.calledWith怎么用?TypeScript SinonSpy.calledWith使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sinon.SinonSpy
的用法示例。
在下文中一共展示了SinonSpy.calledWith方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("Sets the game name if it is allowed", () => {
const spy: SinonSpy = sinon.spy();
element.element.value = allowedName;
subscribe(channel, spy);
expect(nameInput(element)).to.equal(allowedName);
expect(spy.calledWith(allowedName)).to.equal(true);
});
示例2: it
it('Set router path on click', () => {
const link = new Link();
link.__setCoreProperties__({ bind: link, baseRegistry: registry });
link.__setProperties__({ to: '#foo/static', isOutlet: false, registry });
const dNode: any = link.__render__();
assert.strictEqual(dNode.tag, 'a');
assert.strictEqual(dNode.properties.href, '#foo/static');
dNode.properties.onclick.call(link, createMockEvent());
assert.isTrue(routerSetPathSpy.calledWith('#foo/static'));
});
示例3:
.then(() => log.calledWith('client disconnected'));
示例4: it
it('logs client connected', () => {
log.calledWith('client connected');
});
示例5: it
it("Calls a method defining what to do on unsuccessful login", () => {
handleLogin(success, failure, {status: unauthorizedConnection});
expect(failure.calledWith(unsuccessfulLoginMessage)).to.equal(true);
});