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


TypeScript should.equal函数代码示例

本文整理汇总了TypeScript中should.equal函数的典型用法代码示例。如果您正苦于以下问题:TypeScript equal函数的具体用法?TypeScript equal怎么用?TypeScript equal使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了equal函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: async

			}, async () => {

				const val = await client.smembers('test1');
				should.equal(val.length, 2);
				should.equal(val[0], '1');

			});
开发者ID:AdExchangeGrp,项目名称:aeg-redis,代码行数:7,代码来源:index.integration.test.ts

示例2: it

		it('should execute batch operation sets', async () => {

			await client.set('test-batch-1', 1);
			await client.set('test-batch-2', 2);

			let batch = client.batch();
			batch.get('test-batch-1');
			batch.get('test-batch-2');
			let result = await batch.exec();
			should(result).be.instanceOf(Array);
			should.equal(result.length, 2);
			result[0].should.be.equal('1');
			result[1].should.be.equal('2');

			await client.del('test-batch-1');
			await client.del('test-batch-2');

			await client.hmset('test-batch-1', {test: 1});
			await client.hmset('test-batch-2', {test: 2});

			batch = client.batch();
			batch.hgetall('test-batch-1');
			batch.hgetall('test-batch-2');
			result = await batch.exec();
			should(result).be.instanceOf(Array);
			should.equal(result.length, 2);
			result[0].should.be.eql({test: '1'});
			result[1].should.be.eql({test: '2'});

			await client.del('test-batch-1');
			await client.del('test-batch-2');

			await client.sadd('test-batch-1', 1);
			await client.sadd('test-batch-2', 2);

			batch = client.batch();
			batch.smembers('test-batch-1');
			batch.smembers('test-batch-2');
			result = await batch.exec();
			should(result).be.instanceOf(Array);
			should.equal(result.length, 2);
			result[0].should.be.eql(['1']);
			result[1].should.be.eql(['2']);

			await client.del('test-batch-1');
			await client.del('test-batch-2');

		});
开发者ID:AdExchangeGrp,项目名称:aeg-redis,代码行数:48,代码来源:index.integration.test.ts

示例3: checkUnimplemented

 async function checkUnimplemented() {
   const endpointThrow = client.makeEndpoint('notImplemented', instance);
   should.exist(endpoint);
   const result = await endpointThrow(request);
   should.not.exist(result.data);
   should.exist(result.error);
   should.equal(result.error.message, 'unimplemented');
 });
开发者ID:restorecommerce,项目名称:chassis-srv,代码行数:8,代码来源:transport_test.ts

示例4: it

 it('should update status to COMPLETED and delete it from cache', async function () {
   await store.append('1', { id: '1', test: true }, { body: true });
   const cache = await store.setStatus('1', 'COMPLETED');
   cache.should.eql({
     headers: { id: '1', test: true, status: 'COMPLETED', aggregationNum: 1, timeoutNum: 0 },
     body: [{ body: true }]
   });
   should.equal(undefined, await store.getById('1'));
 });
开发者ID:Workable,项目名称:aggregator-eip,代码行数:9,代码来源:memory-store.test.ts

示例5: it

    it('should call filter and return undefined', async function () {
      filterFn.returns(false);

      const result = await filter.process('event');
      should.equal(undefined, result);
      filterFn.args.should.eql([
        ['event']
      ]);
    });
开发者ID:Workable,项目名称:aggregator-eip,代码行数:9,代码来源:filter.test.ts


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