當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。