@types/node 18.17.11 → 18.17.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
node v18.17/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for Node.js (https://nodejs.org/).
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node/v18.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Thu, 24 Aug 2023 22:03:17 GMT
11
+ * Last updated: Mon, 28 Aug 2023 00:33:01 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
14
14
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "18.17.11",
3
+ "version": "18.17.12",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -232,6 +232,6 @@
232
232
  },
233
233
  "scripts": {},
234
234
  "dependencies": {},
235
- "typesPublisherContentHash": "2c7fab874e636c1fe036a027917b5774caaf6b5d1ecd18b0e9ea9355e359d769",
235
+ "typesPublisherContentHash": "42b2e48cacb4776d62b695deffaffacdaf029bcaa951a0a2ff1cbec3e8b7e01f",
236
236
  "typeScriptVersion": "4.3"
237
237
  }
node v18.17/test.d.ts CHANGED
@@ -167,9 +167,8 @@ declare module 'node:test' {
167
167
 
168
168
  /**
169
169
  * The type of a function under Suite.
170
- * If the test uses callbacks, the callback function is passed as an argument
171
170
  */
172
- type SuiteFn = (done: (result?: any) => void) => void;
171
+ type SuiteFn = (s: SuiteContext) => void | Promise<void>;
173
172
 
174
173
  interface RunOptions {
175
174
  /**
@@ -386,6 +385,24 @@ declare module 'node:test' {
386
385
  readonly mock: MockTracker;
387
386
  }
388
387
 
388
+ /**
389
+ * An instance of `SuiteContext` is passed to each suite function in order to
390
+ * interact with the test runner. However, the `SuiteContext` constructor is not
391
+ * exposed as part of the API.
392
+ * @since v18.7.0, v16.17.0
393
+ */
394
+ class SuiteContext {
395
+ /**
396
+ * The name of the suite.
397
+ * @since v18.8.0, v16.18.0
398
+ */
399
+ readonly name: string;
400
+ /**
401
+ * Can be used to abort test subtasks when the test has been aborted.
402
+ * @since v18.7.0, v16.17.0
403
+ */
404
+ readonly signal: AbortSignal;
405
+ }
389
406
  interface TestOptions {
390
407
  /**
391
408
  * If a number is provided, then that many tests would run in parallel.
@@ -473,7 +490,7 @@ declare module 'node:test' {
473
490
  * The hook function. If the hook uses callbacks, the callback function is passed as the
474
491
  * second argument.
475
492
  */
476
- type HookFn = (done: (result?: any) => void) => any;
493
+ type HookFn = (s: SuiteContext, done: (result?: any) => void) => any;
477
494
 
478
495
  /**
479
496
  * Configuration options for hooks.
@@ -166,9 +166,8 @@ declare module 'node:test' {
166
166
 
167
167
  /**
168
168
  * The type of a function under Suite.
169
- * If the test uses callbacks, the callback function is passed as an argument
170
169
  */
171
- type SuiteFn = (done: (result?: any) => void) => void;
170
+ type SuiteFn = (s: SuiteContext) => void | Promise<void>;
172
171
 
173
172
  interface RunOptions {
174
173
  /**
@@ -372,6 +371,24 @@ declare module 'node:test' {
372
371
  readonly mock: MockTracker;
373
372
  }
374
373
 
374
+ /**
375
+ * An instance of `SuiteContext` is passed to each suite function in order to
376
+ * interact with the test runner. However, the `SuiteContext` constructor is not
377
+ * exposed as part of the API.
378
+ * @since v18.7.0, v16.17.0
379
+ */
380
+ class SuiteContext {
381
+ /**
382
+ * The name of the suite.
383
+ * @since v18.8.0, v16.18.0
384
+ */
385
+ readonly name: string;
386
+ /**
387
+ * Can be used to abort test subtasks when the test has been aborted.
388
+ * @since v18.7.0, v16.17.0
389
+ */
390
+ readonly signal: AbortSignal;
391
+ }
375
392
  interface TestOptions {
376
393
  /**
377
394
  * If a number is provided, then that many tests would run in parallel.
@@ -459,7 +476,7 @@ declare module 'node:test' {
459
476
  * The hook function. If the hook uses callbacks, the callback function is passed as the
460
477
  * second argument.
461
478
  */
462
- type HookFn = (done: (result?: any) => void) => any;
479
+ type HookFn = (s: SuiteContext, done: (result?: any) => void) => any;
463
480
 
464
481
  /**
465
482
  * Configuration options for hooks.