@types/node 18.11.8 → 18.11.10

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.
Files changed (4) hide show
  1. node/README.md +1 -1
  2. node/package.json +4 -4
  3. node/test.d.ts +62 -2
  4. node/ts4.8/test.d.ts +62 -2
node/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.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Sun, 30 Oct 2022 19:32:58 GMT
11
+ * Last updated: Wed, 30 Nov 2022 20:33:20 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
14
14
 
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "18.11.8",
3
+ "version": "18.11.10",
4
4
  "description": "TypeScript definitions for Node.js",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
6
6
  "license": "MIT",
@@ -214,7 +214,7 @@
214
214
  "main": "",
215
215
  "types": "index.d.ts",
216
216
  "typesVersions": {
217
- "<4.9.0-0": {
217
+ "<=4.8": {
218
218
  "*": [
219
219
  "ts4.8/*"
220
220
  ]
@@ -227,6 +227,6 @@
227
227
  },
228
228
  "scripts": {},
229
229
  "dependencies": {},
230
- "typesPublisherContentHash": "a23a6d5ceb48ac0215ccd7cba47e75f2a3ae678b228d576c89294138777a2847",
231
- "typeScriptVersion": "4.1"
230
+ "typesPublisherContentHash": "deae126fc88619f9892c2135cc3b8dbc43f2892425329535f88a264883fa32bc",
231
+ "typeScriptVersion": "4.2"
232
232
  }
node/test.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The `node:test` module provides a standalone testing module.
3
- * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/test.js)
3
+ * @see [source](https://github.com/nodejs/node/blob/v18.8.0/lib/test.js)
4
4
  */
5
5
  declare module 'node:test' {
6
6
  /**
@@ -310,5 +310,65 @@ declare module 'node:test' {
310
310
  todo?: boolean | string;
311
311
  }
312
312
 
313
- export { test as default, run, test, describe, it };
313
+ /**
314
+ * This function is used to create a hook running before running a suite.
315
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
316
+ * the second argument. Default: A no-op function.
317
+ * @param options Configuration options for the hook.
318
+ * @since v18.8.0
319
+ */
320
+ function before(fn?: HookFn, options?: HookOptions): void;
321
+
322
+ /**
323
+ * This function is used to create a hook running after running a suite.
324
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
325
+ * the second argument. Default: A no-op function.
326
+ * @param options Configuration options for the hook.
327
+ * @since v18.8.0
328
+ */
329
+ function after(fn?: HookFn, options?: HookOptions): void;
330
+
331
+ /**
332
+ * This function is used to create a hook running before each subtest of the current suite.
333
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
334
+ * the second argument. Default: A no-op function.
335
+ * @param options Configuration options for the hook.
336
+ * @since v18.8.0
337
+ */
338
+ function beforeEach(fn?: HookFn, options?: HookOptions): void;
339
+
340
+ /**
341
+ * This function is used to create a hook running after each subtest of the current test.
342
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
343
+ * the second argument. Default: A no-op function.
344
+ * @param options Configuration options for the hook.
345
+ * @since v18.8.0
346
+ */
347
+ function afterEach(fn?: HookFn, options?: HookOptions): void;
348
+
349
+ /**
350
+ * The hook function. If the hook uses callbacks, the callback function is passed as the
351
+ * second argument.
352
+ */
353
+ type HookFn = (done: (result?: any) => void) => any;
354
+
355
+ /**
356
+ * Configuration options for hooks.
357
+ * @since v18.8.0
358
+ */
359
+ interface HookOptions {
360
+ /**
361
+ * Allows aborting an in-progress hook.
362
+ */
363
+ signal?: AbortSignal;
364
+
365
+ /**
366
+ * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this
367
+ * value from their parent.
368
+ * @default Infinity
369
+ */
370
+ timeout?: number;
371
+ }
372
+
373
+ export { test as default, run, test, describe, it, before, after, beforeEach, afterEach };
314
374
  }
node/ts4.8/test.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * The `node:test` module provides a standalone testing module.
3
- * @see [source](https://github.com/nodejs/node/blob/v18.0.0/lib/test.js)
3
+ * @see [source](https://github.com/nodejs/node/blob/v18.8.0/lib/test.js)
4
4
  */
5
5
  declare module 'node:test' {
6
6
  /**
@@ -310,5 +310,65 @@ declare module 'node:test' {
310
310
  todo?: boolean | string;
311
311
  }
312
312
 
313
- export { test as default, run, test, describe, it };
313
+ /**
314
+ * This function is used to create a hook running before running a suite.
315
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
316
+ * the second argument. Default: A no-op function.
317
+ * @param options Configuration options for the hook.
318
+ * @since v18.8.0
319
+ */
320
+ function before(fn?: HookFn, options?: HookOptions): void;
321
+
322
+ /**
323
+ * This function is used to create a hook running after running a suite.
324
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
325
+ * the second argument. Default: A no-op function.
326
+ * @param options Configuration options for the hook.
327
+ * @since v18.8.0
328
+ */
329
+ function after(fn?: HookFn, options?: HookOptions): void;
330
+
331
+ /**
332
+ * This function is used to create a hook running before each subtest of the current suite.
333
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
334
+ * the second argument. Default: A no-op function.
335
+ * @param options Configuration options for the hook.
336
+ * @since v18.8.0
337
+ */
338
+ function beforeEach(fn?: HookFn, options?: HookOptions): void;
339
+
340
+ /**
341
+ * This function is used to create a hook running after each subtest of the current test.
342
+ * @param fn The hook function. If the hook uses callbacks, the callback function is passed as
343
+ * the second argument. Default: A no-op function.
344
+ * @param options Configuration options for the hook.
345
+ * @since v18.8.0
346
+ */
347
+ function afterEach(fn?: HookFn, options?: HookOptions): void;
348
+
349
+ /**
350
+ * The hook function. If the hook uses callbacks, the callback function is passed as the
351
+ * second argument.
352
+ */
353
+ type HookFn = (done: (result?: any) => void) => any;
354
+
355
+ /**
356
+ * Configuration options for hooks.
357
+ * @since v18.8.0
358
+ */
359
+ interface HookOptions {
360
+ /**
361
+ * Allows aborting an in-progress hook.
362
+ */
363
+ signal?: AbortSignal;
364
+
365
+ /**
366
+ * A number of milliseconds the hook will fail after. If unspecified, subtests inherit this
367
+ * value from their parent.
368
+ * @default Infinity
369
+ */
370
+ timeout?: number;
371
+ }
372
+
373
+ export { test as default, run, test, describe, it, before, after, beforeEach, afterEach };
314
374
  }