Skip to content

assert: add expect() #65247

Description

@cjihrig

What is the problem this feature will solve?

expect() is a popular way of writing assertions. From what I've been able to tell, many developers prefer writing assertions in this style compared to the current assertion style provided by node:assert. Many batteries included test runners (Jest, Vitest, bun:test, etc.) expose this API.

What is the feature you are proposing to solve the problem?

node:assert exports the expect() API.

What alternatives have you considered?

Use the existing node:assert assertions or install expect() from npm.

Metadata

Metadata

Assignees

No one assigned

    Labels

    assertIssues and PRs related to the assert subsystem.feature requestIssues that request new features to be added to Node.js.

    Type

    No type

    Projects

    Status
    Awaiting Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions