Skip to content

no way to programmatically discover node:test #42785

@ljharb

Description

@ljharb

Version

18.0.0

Platform

No response

Subsystem

No response

What steps will reproduce the bug?

require('module').builtinModules

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

Everything that's requireable that ships with node is listed (or, the listed items are requireable with node: added).

What do you see instead?

node:test is not listed.

Additional information

There needs to be a way to programmatically discover all builtin modules. require('module').builtinModules is supposed to be it.

This broke assumptions in my tests for https://npmjs.com/is-core-module - specifically, CIGTM should have failed prior to node 18 going out, because node:test wasn't part of is-core-module, but by making it effectively "secret", my tests didn't know about it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    moduleIssues and PRs related to the module subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions