当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript SinonSpy.calledWith方法代码示例

本文整理汇总了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);
 });
开发者ID:Ruddickmg,项目名称:js-wars,代码行数:7,代码来源:gameNameEntry.spec.ts

示例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'));
	});
开发者ID:mwistrand,项目名称:routing,代码行数:10,代码来源:Link.ts

示例3:

					.then(() => log.calledWith('client disconnected'));
开发者ID:Agamnentzar,项目名称:ag-sockets,代码行数:1,代码来源:serverClient.spec.ts

示例4: it

			it('logs client connected', () => {
				log.calledWith('client connected');
			});
开发者ID:Agamnentzar,项目名称:ag-sockets,代码行数:3,代码来源:serverClient.spec.ts

示例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);
 });
开发者ID:Ruddickmg,项目名称:js-wars,代码行数:4,代码来源:handleLoginAttempt.spec.ts


注:本文中的Sinon.SinonSpy.calledWith方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。