@types/node 22.6.0 → 22.6.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.
- node/README.md +1 -1
- node/package.json +2 -2
- node/test.d.ts +65 -1
node/README.md
CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for node (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: Mon, 23 Sep 2024
|
11
|
+
* Last updated: Mon, 23 Sep 2024 21:07:32 GMT
|
12
12
|
* Dependencies: [undici-types](https://npmjs.com/package/undici-types)
|
13
13
|
|
14
14
|
# Credits
|
node/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@types/node",
|
3
|
-
"version": "22.6.
|
3
|
+
"version": "22.6.1",
|
4
4
|
"description": "TypeScript definitions for node",
|
5
5
|
"homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/node",
|
6
6
|
"license": "MIT",
|
@@ -212,6 +212,6 @@
|
|
212
212
|
"dependencies": {
|
213
213
|
"undici-types": "~6.19.2"
|
214
214
|
},
|
215
|
-
"typesPublisherContentHash": "
|
215
|
+
"typesPublisherContentHash": "1445f8e238b8d2b5072d175305ab08953ef767426c16d5ae023784aefd6098a0",
|
216
216
|
"typeScriptVersion": "4.8"
|
217
217
|
}
|
node/test.d.ts
CHANGED
@@ -486,7 +486,7 @@ declare module "node:test" {
|
|
486
486
|
/**
|
487
487
|
* An object containing assertion methods bound to the test context.
|
488
488
|
* The top-level functions from the `node:assert` module are exposed here for the purpose of creating test plans.
|
489
|
-
* @since v22.2.0
|
489
|
+
* @since v22.2.0, v20.15.0
|
490
490
|
*/
|
491
491
|
readonly assert: TestContextAssert;
|
492
492
|
/**
|
@@ -670,6 +670,22 @@ declare module "node:test" {
|
|
670
670
|
deepEqual: typeof import("node:assert").deepEqual;
|
671
671
|
/**
|
672
672
|
* Identical to the `deepStrictEqual` function from the `node:assert` module, but bound to the test context.
|
673
|
+
*
|
674
|
+
* **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a
|
675
|
+
* type annotation, otherwise an error will be raised by the TypeScript compiler:
|
676
|
+
* ```ts
|
677
|
+
* import { test, type TestContext } from 'node:test';
|
678
|
+
*
|
679
|
+
* // The test function's context parameter must have a type annotation.
|
680
|
+
* test('example', (t: TestContext) => {
|
681
|
+
* t.assert.deepStrictEqual(actual, expected);
|
682
|
+
* });
|
683
|
+
*
|
684
|
+
* // Omitting the type annotation will result in a compilation error.
|
685
|
+
* test('example', t => {
|
686
|
+
* t.assert.deepStrictEqual(actual, expected); // Error: 't' needs an explicit type annotation.
|
687
|
+
* });
|
688
|
+
* ```
|
673
689
|
*/
|
674
690
|
deepStrictEqual: typeof import("node:assert").deepStrictEqual;
|
675
691
|
/**
|
@@ -694,6 +710,22 @@ declare module "node:test" {
|
|
694
710
|
fail: typeof import("node:assert").fail;
|
695
711
|
/**
|
696
712
|
* Identical to the `ifError` function from the `node:assert` module, but bound to the test context.
|
713
|
+
*
|
714
|
+
* **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a
|
715
|
+
* type annotation, otherwise an error will be raised by the TypeScript compiler:
|
716
|
+
* ```ts
|
717
|
+
* import { test, type TestContext } from 'node:test';
|
718
|
+
*
|
719
|
+
* // The test function's context parameter must have a type annotation.
|
720
|
+
* test('example', (t: TestContext) => {
|
721
|
+
* t.assert.ifError(err);
|
722
|
+
* });
|
723
|
+
*
|
724
|
+
* // Omitting the type annotation will result in a compilation error.
|
725
|
+
* test('example', t => {
|
726
|
+
* t.assert.ifError(err); // Error: 't' needs an explicit type annotation.
|
727
|
+
* });
|
728
|
+
* ```
|
697
729
|
*/
|
698
730
|
ifError: typeof import("node:assert").ifError;
|
699
731
|
/**
|
@@ -718,6 +750,22 @@ declare module "node:test" {
|
|
718
750
|
notStrictEqual: typeof import("node:assert").notStrictEqual;
|
719
751
|
/**
|
720
752
|
* Identical to the `ok` function from the `node:assert` module, but bound to the test context.
|
753
|
+
*
|
754
|
+
* **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a
|
755
|
+
* type annotation, otherwise an error will be raised by the TypeScript compiler:
|
756
|
+
* ```ts
|
757
|
+
* import { test, type TestContext } from 'node:test';
|
758
|
+
*
|
759
|
+
* // The test function's context parameter must have a type annotation.
|
760
|
+
* test('example', (t: TestContext) => {
|
761
|
+
* t.assert.ok(condition);
|
762
|
+
* });
|
763
|
+
*
|
764
|
+
* // Omitting the type annotation will result in a compilation error.
|
765
|
+
* test('example', t => {
|
766
|
+
* t.assert.ok(condition)); // Error: 't' needs an explicit type annotation.
|
767
|
+
* });
|
768
|
+
* ```
|
721
769
|
*/
|
722
770
|
ok: typeof import("node:assert").ok;
|
723
771
|
/**
|
@@ -726,6 +774,22 @@ declare module "node:test" {
|
|
726
774
|
rejects: typeof import("node:assert").rejects;
|
727
775
|
/**
|
728
776
|
* Identical to the `strictEqual` function from the `node:assert` module, but bound to the test context.
|
777
|
+
*
|
778
|
+
* **Note:** as this method returns a type assertion, the context parameter in the callback signature must have a
|
779
|
+
* type annotation, otherwise an error will be raised by the TypeScript compiler:
|
780
|
+
* ```ts
|
781
|
+
* import { test, type TestContext } from 'node:test';
|
782
|
+
*
|
783
|
+
* // The test function's context parameter must have a type annotation.
|
784
|
+
* test('example', (t: TestContext) => {
|
785
|
+
* t.assert.strictEqual(actual, expected);
|
786
|
+
* });
|
787
|
+
*
|
788
|
+
* // Omitting the type annotation will result in a compilation error.
|
789
|
+
* test('example', t => {
|
790
|
+
* t.assert.strictEqual(actual, expected); // Error: 't' needs an explicit type annotation.
|
791
|
+
* });
|
792
|
+
* ```
|
729
793
|
*/
|
730
794
|
strictEqual: typeof import("node:assert").strictEqual;
|
731
795
|
/**
|