-
Notifications
You must be signed in to change notification settings - Fork 623
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
test(async): improve test coverage #4567
Conversation
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.
Nicely done! I have just a couple of nits. Let's also remove the unreachable code from mux_async_iterator.ts
.
async/pool_test.ts
Outdated
@@ -22,7 +22,7 @@ Deno.test("pooledMap()", async function () { | |||
assert(diff < 3000); | |||
}); | |||
|
|||
Deno.test("pooledMap() handles errors", async () => { | |||
Deno.test("pooledMap() handles errors", async 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.
Nit: we generally use the arrow syntax for anonymous functions. Please revert. Ditto elsewhere.
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.
understood! also took liberty to convert the other test cases in the async sub-module to make use of the arrow syntax as well.
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.
LGTM! Good stuff. Thank you.
working towards #3713.
pushes code coverage of the
async
sub-module closer to 100%.the two remaining files in the sub-module which aren't at 100% are:
mux_async_iterator.ts
:resetting the errors via
this.#throws.length = 0
seems to be unreachable code.if we have a truthy value for
this.#throws.length
we would throw all of the errors, thus exitingiterate
.pool.ts
:the
catch
block as well as the error handling seems to be covered by tests already.