This is not

Like what you see? Install OctoLinker now!

Skip to content
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

Coverage gap #57

Gabisampaio opened this issue Mar 7, 2022 · 0 comments

Coverage gap #57

Gabisampaio opened this issue Mar 7, 2022 · 0 comments


Copy link

@Gabisampaio Gabisampaio commented Mar 7, 2022

I used Istanbul to measure coverage of the test suite and I believe that I found a minor coverage gap.

It looks like the condition of the following if statement never holds.

if (typeof mapper !== 'function') {
  throw new TypeError('Mapper function is required');

It is a corner case and probably unlikely to happen, but it may be worth including a test just to make sure this property will hold in future. I include a suggestion of test below, which passes when I run locally.

test('invalid mapper', async t => {
  await t.throwsAsync(pMap([], "invalid mapper", {concurrency: 2}), TypeError);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

No branches or pull requests

1 participant