-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TokenPool: Add debug logging helper + return correct error #2400
Conversation
Slice another sliver from #1205.
Generated by 🚫 dangerJS |
while ( | ||
!this.priorityQueue.isEmpty() && | ||
(next = this.priorityQueue.peek()) | ||
) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the bug fix ^^
context('when empty', function() { | ||
it('next() should return the expected error', function() { | ||
const tokenPool = new TokenPool() | ||
expect(() => tokenPool.next()).to.throw('Token pool is exhausted') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Previously the error was Priority queue is empty, which is incorrect.
798b5fd
to
c93dc1e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from a small mistake in a test's description, this looks good to me! 👍
lib/token-pool.spec.js
Outdated
}) | ||
}) | ||
|
||
context('with sanitize: true', function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you mean "false" here?
Slice another sliver from #1205.