Skip to content

validate arguments to mustCall(), default value

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Affected core subsystem(s)

test

Description of change

Updates the mustCall() function in test/common.js to use to default the expected parameter to 1 and validate that it is a non-negative number.

This change will prevent issues such as the one fixed in the first commit on https://github.com/nodejs/node/pull/9031

Merge request reports

Loading