@types/node 20.1.7 → 20.2.1

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 (5) hide show
  1. node/README.md +1 -1
  2. node/index.d.ts +1 -1
  3. node/package.json +2 -2
  4. node/test.d.ts +57 -1
  5. node/ts4.8/test.d.ts +70 -18
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: Tue, 16 May 2023 20:02:56 GMT
11
+ * Last updated: Thu, 18 May 2023 13:32:52 GMT
12
12
  * Dependencies: none
13
13
  * Global values: `AbortController`, `AbortSignal`, `__dirname`, `__filename`, `console`, `exports`, `gc`, `global`, `module`, `process`, `require`, `structuredClone`
14
14
 
node/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- // Type definitions for non-npm package Node.js 20.1
1
+ // Type definitions for non-npm package Node.js 20.2
2
2
  // Project: https://nodejs.org/
3
3
  // Definitions by: Microsoft TypeScript <https://github.com/Microsoft>
4
4
  // DefinitelyTyped <https://github.com/DefinitelyTyped>
node/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/node",
3
- "version": "20.1.7",
3
+ "version": "20.2.1",
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": "66c03deccac83a7d603defb282c78bd668ddc17b46fda8c94bc538f577bb3567",
235
+ "typesPublisherContentHash": "605a2e642a0979c9b4e6102f238e63c9667e686359383a32c94507a33a0c61a0",
236
236
  "typeScriptVersion": "4.3"
237
237
  }
node/test.d.ts CHANGED
@@ -135,6 +135,22 @@ declare module 'node:test' {
135
135
  function test(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
136
136
  function test(options?: TestOptions, fn?: TestFn): Promise<void>;
137
137
  function test(fn?: TestFn): Promise<void>;
138
+ namespace test {
139
+ export {
140
+ after,
141
+ afterEach,
142
+ before,
143
+ beforeEach,
144
+ describe,
145
+ it,
146
+ run,
147
+ mock,
148
+ test,
149
+ skip,
150
+ todo,
151
+ only
152
+ };
153
+ }
138
154
  /**
139
155
  * The `describe()` function imported from the `node:test` module. Each
140
156
  * invocation of this function results in the creation of a Subtest.
@@ -164,6 +180,14 @@ declare module 'node:test' {
164
180
  function todo(name?: string, fn?: SuiteFn): void;
165
181
  function todo(options?: TestOptions, fn?: SuiteFn): void;
166
182
  function todo(fn?: SuiteFn): void;
183
+ /**
184
+ * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`.
185
+ * @since v18.15.0
186
+ */
187
+ function only(name?: string, options?: TestOptions, fn?: SuiteFn): void;
188
+ function only(name?: string, fn?: SuiteFn): void;
189
+ function only(options?: TestOptions, fn?: SuiteFn): void;
190
+ function only(fn?: SuiteFn): void;
167
191
  }
168
192
  /**
169
193
  * Shorthand for `test()`.
@@ -186,7 +210,39 @@ declare module 'node:test' {
186
210
  function todo(name?: string, fn?: TestFn): void;
187
211
  function todo(options?: TestOptions, fn?: TestFn): void;
188
212
  function todo(fn?: TestFn): void;
213
+ /**
214
+ * Shorthand for marking a test as `only`, same as `it([name], { only: true }[, fn])`.
215
+ * @since v18.15.0
216
+ */
217
+ function only(name?: string, options?: TestOptions, fn?: TestFn): void;
218
+ function only(name?: string, fn?: TestFn): void;
219
+ function only(options?: TestOptions, fn?: TestFn): void;
220
+ function only(fn?: TestFn): void;
189
221
  }
222
+ /**
223
+ * Shorthand for skipping a test, same as `test([name], { skip: true }[, fn])`.
224
+ * @since v20.2.0
225
+ */
226
+ function skip(name?: string, options?: TestOptions, fn?: TestFn): void;
227
+ function skip(name?: string, fn?: TestFn): void;
228
+ function skip(options?: TestOptions, fn?: TestFn): void;
229
+ function skip(fn?: TestFn): void;
230
+ /**
231
+ * Shorthand for marking a test as `TODO`, same as `test([name], { todo: true }[, fn])`.
232
+ * @since v20.2.0
233
+ */
234
+ function todo(name?: string, options?: TestOptions, fn?: TestFn): void;
235
+ function todo(name?: string, fn?: TestFn): void;
236
+ function todo(options?: TestOptions, fn?: TestFn): void;
237
+ function todo(fn?: TestFn): void;
238
+ /**
239
+ * Shorthand for marking a test as `only`, same as `test([name], { only: true }[, fn])`.
240
+ * @since v20.2.0
241
+ */
242
+ function only(name?: string, options?: TestOptions, fn?: TestFn): void;
243
+ function only(name?: string, fn?: TestFn): void;
244
+ function only(options?: TestOptions, fn?: TestFn): void;
245
+ function only(fn?: TestFn): void;
190
246
  /**
191
247
  * The type of a function under test. The first argument to this function is a
192
248
  * {@link TestContext} object. If the test uses callbacks, the callback function is passed as
@@ -988,5 +1044,5 @@ declare module 'node:test' {
988
1044
  */
989
1045
  restore(): void;
990
1046
  }
991
- export { test as default, run, test, describe, it, before, after, beforeEach, afterEach, mock };
1047
+ export { test as default, run, test, describe, it, before, after, beforeEach, afterEach, mock, skip, only, todo };
992
1048
  }
node/ts4.8/test.d.ts CHANGED
@@ -135,6 +135,22 @@ declare module 'node:test' {
135
135
  function test(name?: string, options?: TestOptions, fn?: TestFn): Promise<void>;
136
136
  function test(options?: TestOptions, fn?: TestFn): Promise<void>;
137
137
  function test(fn?: TestFn): Promise<void>;
138
+ namespace test {
139
+ export {
140
+ after,
141
+ afterEach,
142
+ before,
143
+ beforeEach,
144
+ describe,
145
+ it,
146
+ run,
147
+ mock,
148
+ test,
149
+ skip,
150
+ todo,
151
+ only
152
+ };
153
+ }
138
154
  /**
139
155
  * The `describe()` function imported from the `node:test` module. Each
140
156
  * invocation of this function results in the creation of a Subtest.
@@ -164,6 +180,15 @@ declare module 'node:test' {
164
180
  function todo(name?: string, fn?: SuiteFn): void;
165
181
  function todo(options?: TestOptions, fn?: SuiteFn): void;
166
182
  function todo(fn?: SuiteFn): void;
183
+
184
+ /**
185
+ * Shorthand for marking a suite as `only`, same as `describe([name], { only: true }[, fn])`.
186
+ * @since v18.15.0
187
+ */
188
+ function only(name?: string, options?: TestOptions, fn?: SuiteFn): void;
189
+ function only(name?: string, fn?: SuiteFn): void;
190
+ function only(options?: TestOptions, fn?: SuiteFn): void;
191
+ function only(fn?: SuiteFn): void;
167
192
  }
168
193
  /**
169
194
  * Shorthand for `test()`.
@@ -171,22 +196,54 @@ declare module 'node:test' {
171
196
  * The `it()` function is imported from the `node:test` module.
172
197
  * @since v18.6.0, v16.17.0
173
198
  */
174
- function it(name?: string, options?: TestOptions, fn?: ItFn): void;
175
- function it(name?: string, fn?: ItFn): void;
176
- function it(options?: TestOptions, fn?: ItFn): void;
177
- function it(fn?: ItFn): void;
199
+ function it(name?: string, options?: TestOptions, fn?: TestFn): void;
200
+ function it(name?: string, fn?: TestFn): void;
201
+ function it(options?: TestOptions, fn?: TestFn): void;
202
+ function it(fn?: TestFn): void;
178
203
  namespace it {
179
204
  // Shorthand for skipping a test, same as `it([name], { skip: true }[, fn])`.
180
- function skip(name?: string, options?: TestOptions, fn?: ItFn): void;
181
- function skip(name?: string, fn?: ItFn): void;
182
- function skip(options?: TestOptions, fn?: ItFn): void;
183
- function skip(fn?: ItFn): void;
205
+ function skip(name?: string, options?: TestOptions, fn?: TestFn): void;
206
+ function skip(name?: string, fn?: TestFn): void;
207
+ function skip(options?: TestOptions, fn?: TestFn): void;
208
+ function skip(fn?: TestFn): void;
184
209
  // Shorthand for marking a test as `TODO`, same as `it([name], { todo: true }[, fn])`.
185
- function todo(name?: string, options?: TestOptions, fn?: ItFn): void;
186
- function todo(name?: string, fn?: ItFn): void;
187
- function todo(options?: TestOptions, fn?: ItFn): void;
188
- function todo(fn?: ItFn): void;
210
+ function todo(name?: string, options?: TestOptions, fn?: TestFn): void;
211
+ function todo(name?: string, fn?: TestFn): void;
212
+ function todo(options?: TestOptions, fn?: TestFn): void;
213
+ function todo(fn?: TestFn): void;
214
+ /**
215
+ * Shorthand for marking a test as `only`, same as `it([name], { only: true }[, fn])`.
216
+ * @since v18.15.0
217
+ */
218
+ function only(name?: string, options?: TestOptions, fn?: TestFn): void;
219
+ function only(name?: string, fn?: TestFn): void;
220
+ function only(options?: TestOptions, fn?: TestFn): void;
221
+ function only(fn?: TestFn): void;
189
222
  }
223
+ /**
224
+ * Shorthand for skipping a test, same as `test([name], { skip: true }[, fn])`.
225
+ * @since v20.2.0
226
+ */
227
+ function skip(name?: string, options?: TestOptions, fn?: TestFn): void;
228
+ function skip(name?: string, fn?: TestFn): void;
229
+ function skip(options?: TestOptions, fn?: TestFn): void;
230
+ function skip(fn?: TestFn): void;
231
+ /**
232
+ * Shorthand for marking a test as `TODO`, same as `test([name], { todo: true }[, fn])`.
233
+ * @since v20.2.0
234
+ */
235
+ function todo(name?: string, options?: TestOptions, fn?: TestFn): void;
236
+ function todo(name?: string, fn?: TestFn): void;
237
+ function todo(options?: TestOptions, fn?: TestFn): void;
238
+ function todo(fn?: TestFn): void;
239
+ /**
240
+ * Shorthand for marking a test as `only`, same as `test([name], { only: true }[, fn])`.
241
+ * @since v20.2.0
242
+ */
243
+ function only(name?: string, options?: TestOptions, fn?: TestFn): void;
244
+ function only(name?: string, fn?: TestFn): void;
245
+ function only(options?: TestOptions, fn?: TestFn): void;
246
+ function only(fn?: TestFn): void;
190
247
  /**
191
248
  * The type of a function under test. The first argument to this function is a
192
249
  * {@link TestContext} object. If the test uses callbacks, the callback function is passed as
@@ -198,11 +255,6 @@ declare module 'node:test' {
198
255
  * If the test uses callbacks, the callback function is passed as an argument
199
256
  */
200
257
  type SuiteFn = (done: (result?: any) => void) => void;
201
- /**
202
- * The type of a function under test.
203
- * If the test uses callbacks, the callback function is passed as an argument
204
- */
205
- type ItFn = (done: (result?: any) => void) => any;
206
258
  interface RunOptions {
207
259
  /**
208
260
  * If a number is provided, then that many files would run in parallel.
@@ -993,5 +1045,5 @@ declare module 'node:test' {
993
1045
  */
994
1046
  restore(): void;
995
1047
  }
996
- export { test as default, run, test, describe, it, before, after, beforeEach, afterEach, mock };
1048
+ export { test as default, run, test, describe, it, before, after, beforeEach, afterEach, mock, skip, only, todo };
997
1049
  }