本文整理汇总了TypeScript中Sinon.SinonFakeTimers.tick方法的典型用法代码示例。如果您正苦于以下问题:TypeScript SinonFakeTimers.tick方法的具体用法?TypeScript SinonFakeTimers.tick怎么用?TypeScript SinonFakeTimers.tick使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sinon.SinonFakeTimers
的用法示例。
在下文中一共展示了SinonFakeTimers.tick方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: it
it("can integrate", () => {
const acceleration = sinkBehavior(1);
const bIntergrate = integrateFrom(acceleration);
const integration = at(bIntergrate);
assert.strictEqual(at(integration), 0);
clock.tick(2000);
assert.strictEqual(at(integration), 2000);
clock.tick(1000);
assert.strictEqual(at(integration), 3000);
clock.tick(500);
acceleration.push(2);
assert.strictEqual(at(integration), 4000);
});
示例2: it
it('releases the lock', async () => {
await lock.create();
clock.tick(6000);
await new Promise(resolve => {
watcher.once('delete', () => resolve());
});
});
示例3: it
it('should call logger.warn in scheduled job if this.forge throws', async () => {
const expectedError = new Error('err');
forgeStub.throws(expectedError);
const p = inst.onBlockchainReady();
clock.tick(500000);
await p;
expect(loggerStub.stubs.warn.calledOnce).to.be.true;
expect(loggerStub.stubs.warn.firstCall.args[0]).to.be.equal('Error in nextForge');
expect(loggerStub.stubs.warn.firstCall.args[1]).to.be.deep.equal(expectedError);
});
示例4: expect
return iterator.iterate(iterable, (value: any, index: number) => {
expect(value).to.equal(iterable[index]);
clock.tick(speedInMilliseconds);
});
示例5: expect
return typewriter.type(message, (text: string) => {
expect(text).to.equal(message[i++]);
clock.tick(speedInMilliseconds);
});