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