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

test: fix 'checks' validation test for checkPrime #47139

Merged

Commits on Mar 17, 2023

  1. test: fix 'checks' validation test for checkPrime

    This test had two problems:
    
    * The first argument was a number in both cases, which is what caused
      the (expected) ERR_INVALID_ARG_TYPE error -- the validity of the
      'checks' option was not actually verified at all. Thus, the first
      argument should be valid for this particular test.
    * The function returned by common.mustNotCall() was passed to
      assert.throws() as a third argument instead of being passed to
      checkPrime() as a third argument. (Isn't JavaScript great?) This again
      led to the (expected) ERR_INVALID_ARG_TYPE error, but again, the
      validity of the 'checks' option was not verified.
    
    Fix both issues by ensuring that all arguments except the 'checks'
    option are valid.
    
    Refs: nodejs#36997
    tniessen committed Mar 17, 2023
    Configuration menu
    Copy the full SHA
    2416f78 View commit details
    Browse the repository at this point in the history