Skip to content
This repository has been archived by the owner on Sep 13, 2022. It is now read-only.

Commit

Permalink
update comments
Browse files Browse the repository at this point in the history
Signed-off-by: Won Jun Jang <wjang@uber.com>
  • Loading branch information
black-adder committed Apr 6, 2018
1 parent 7a144b5 commit 87c6e0f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/throttler/remote_throttler.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ describe('RemoteThrottler should', () => {
});

it('not fetch credits if uuid is invalid', () => {
throttler = new RemoteThrottler(serviceName);
throttler.setProcess({ uuid: null });
throttler._refreshCredits();
assert.equal(logger._errorMsgs.length, 1, `errors=${logger._errorMsgs}`);
});

it("return false for _isAllowed if operation isn't in _credits or operation has no credits", () => {
Expand Down Expand Up @@ -150,6 +150,10 @@ describe('RemoteThrottler should', () => {
});

it('not fetch credits if no operations have been seen', () => {
throttler = new RemoteThrottler(serviceName, {
refreshIntervalMs: 0,
initialDelayMs: 60000,
});
throttler.setProcess({ uuid: uuid });
throttler._refreshCredits();
assert.equal(Object.keys(throttler._credits).length, 0);
Expand Down

0 comments on commit 87c6e0f

Please sign in to comment.