本文整理汇总了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']
]);
});