Skip to content

Typings for the node test module? #43249

Answered by VoltrexKeyva
Darkle asked this question in General
Discussion options

You must be logged in to vote

The typings for the Node.js runtime and it's built-in modules are mainly provided by @types/node, the typings for experimental APIs (such as the node:test built-in module) are mostly not available until the aforementioned APIs becomes stable.

So if you're using TypeScript, it's better to either test out the module by ignoring the missing typings declaration errors by using a @ts-ignore directive:

// @ts-ignore: typings declaration for the `node:test` built-in module is not yet available.
import test from 'node:test';

Or if you don't want to use the @ts-ignore directive, there's nothing much you can do other than declaring the typings yourself or just using JavaScript instead of TypeScript…

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by Darkle
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 participants