本文整理匯總了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);
});