Skip to content

test: common.expectsError() is subtly broken #13682

Description

@refack
  • Version: *
  • Platform: *
  • Subsystem: test

Ref: #13623 (comment)
as reported by @cjihrig:

common.expectsError() is subtly broken. It relies on instanceof to check the error type. So a TypeError is an instance of Error, which is why this passed. The simplest fix might be to check error.constructor inside of common.expectsError(). But that will require updating a bunch of tests because we're now using custom errors all over the place.

Metadata

Metadata

Assignees

No one assigned

    Labels

    testIssues and PRs related to Node.js core tests and test infrastructure.wipIssues and PRs that are still a work in progress.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions