@mtkruto/node 0.0.971 → 0.0.972
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.
- package/esm/constants.d.ts +1 -1
- package/esm/constants.js +1 -1
- package/esm/deps/deno.land/std@0.196.0/assert/_constants.d.ts +1 -0
- package/esm/deps/deno.land/std@0.196.0/assert/_constants.js +2 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert.d.ts +2 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert.js +8 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_almost_equals.d.ts +18 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_almost_equals.js +32 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_array_includes.d.ts +14 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_array_includes.js +38 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_equals.d.ts +17 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_equals.js +45 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_exists.d.ts +5 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_exists.js +14 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_false.d.ts +4 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_false.js +7 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_instance_of.d.ts +8 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_instance_of.js +38 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_is_error.d.ts +7 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_is_error.js +26 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_match.d.ts +5 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_match.js +13 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_not_equals.d.ts +14 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_not_equals.js +37 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_not_instance_of.d.ts +5 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_not_instance_of.js +14 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_not_match.d.ts +5 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_not_match.js +14 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_not_strict_equals.d.ts +11 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_not_strict_equals.js +20 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_object_match.d.ts +5 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_object_match.js +78 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_rejects.d.ts +64 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_rejects.js +50 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_strict_equals.d.ts +23 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_strict_equals.js +60 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_string_includes.d.ts +5 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_string_includes.js +13 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_throws.d.ts +54 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assert_throws.js +44 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assertion_error.d.ts +4 -0
- package/esm/deps/deno.land/std@0.196.0/assert/assertion_error.js +12 -0
- package/esm/deps/deno.land/std@0.196.0/assert/equal.d.ts +6 -0
- package/esm/deps/deno.land/std@0.196.0/assert/equal.js +102 -0
- package/esm/deps/deno.land/std@0.196.0/assert/fail.d.ts +4 -0
- package/esm/deps/deno.land/std@0.196.0/assert/fail.js +9 -0
- package/esm/deps/deno.land/std@0.196.0/assert/mod.d.ts +32 -0
- package/esm/deps/deno.land/std@0.196.0/assert/mod.js +33 -0
- package/esm/deps/deno.land/std@0.196.0/assert/unimplemented.d.ts +2 -0
- package/esm/deps/deno.land/std@0.196.0/assert/unimplemented.js +7 -0
- package/esm/deps/deno.land/std@0.196.0/assert/unreachable.d.ts +2 -0
- package/esm/deps/deno.land/std@0.196.0/assert/unreachable.js +6 -0
- package/esm/deps/deno.land/{std@0.190.0 → std@0.196.0}/fmt/colors.js +2 -2
- package/{script/deps/deno.land/std@0.190.0 → esm/deps/deno.land/std@0.196.0}/testing/asserts.d.ts +204 -159
- package/esm/deps/deno.land/std@0.196.0/testing/asserts.js +330 -0
- package/esm/deps.d.ts +2 -2
- package/esm/deps.js +2 -2
- package/package.json +1 -1
- package/script/constants.d.ts +1 -1
- package/script/constants.js +1 -1
- package/script/deps/deno.land/std@0.196.0/assert/_constants.d.ts +1 -0
- package/script/deps/deno.land/std@0.196.0/assert/_constants.js +5 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert.d.ts +2 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert.js +12 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_almost_equals.d.ts +18 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_almost_equals.js +36 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_array_includes.d.ts +14 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_array_includes.js +42 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_equals.d.ts +17 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_equals.js +49 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_exists.d.ts +5 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_exists.js +18 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_false.d.ts +4 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_false.js +11 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_instance_of.d.ts +8 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_instance_of.js +42 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_is_error.d.ts +7 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_is_error.js +30 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_match.d.ts +5 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_match.js +17 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_not_equals.d.ts +14 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_not_equals.js +41 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_not_instance_of.d.ts +5 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_not_instance_of.js +18 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_not_match.d.ts +5 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_not_match.js +18 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_not_strict_equals.d.ts +11 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_not_strict_equals.js +24 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_object_match.d.ts +5 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_object_match.js +82 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_rejects.d.ts +64 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_rejects.js +54 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_strict_equals.d.ts +23 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_strict_equals.js +64 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_string_includes.d.ts +5 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_string_includes.js +17 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_throws.d.ts +54 -0
- package/script/deps/deno.land/std@0.196.0/assert/assert_throws.js +48 -0
- package/script/deps/deno.land/std@0.196.0/assert/assertion_error.d.ts +4 -0
- package/script/deps/deno.land/std@0.196.0/assert/assertion_error.js +16 -0
- package/script/deps/deno.land/std@0.196.0/assert/equal.d.ts +6 -0
- package/script/deps/deno.land/std@0.196.0/assert/equal.js +106 -0
- package/script/deps/deno.land/std@0.196.0/assert/fail.d.ts +4 -0
- package/script/deps/deno.land/std@0.196.0/assert/fail.js +13 -0
- package/script/deps/deno.land/std@0.196.0/assert/mod.d.ts +32 -0
- package/script/deps/deno.land/std@0.196.0/assert/mod.js +49 -0
- package/script/deps/deno.land/std@0.196.0/assert/unimplemented.d.ts +2 -0
- package/script/deps/deno.land/std@0.196.0/assert/unimplemented.js +11 -0
- package/script/deps/deno.land/std@0.196.0/assert/unreachable.d.ts +2 -0
- package/script/deps/deno.land/std@0.196.0/assert/unreachable.js +10 -0
- package/script/deps/deno.land/{std@0.190.0 → std@0.196.0}/fmt/colors.js +2 -2
- package/{esm/deps/deno.land/std@0.190.0 → script/deps/deno.land/std@0.196.0}/testing/asserts.d.ts +204 -159
- package/script/deps/deno.land/std@0.196.0/testing/asserts.js +333 -0
- package/script/deps.d.ts +2 -2
- package/script/deps.js +2 -2
- package/esm/deps/deno.land/std@0.190.0/testing/asserts.js +0 -633
- package/script/deps/deno.land/std@0.190.0/testing/asserts.js +0 -659
- /package/esm/deps/deno.land/{std@0.190.0/testing/_diff.d.ts → std@0.196.0/_util/diff.d.ts} +0 -0
- /package/esm/deps/deno.land/{std@0.190.0/testing/_diff.js → std@0.196.0/_util/diff.js} +0 -0
- /package/esm/deps/deno.land/{std@0.190.0/testing → std@0.196.0/assert}/_format.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.190.0/testing → std@0.196.0/assert}/_format.js +0 -0
- /package/esm/deps/deno.land/{std@0.190.0 → std@0.196.0}/encoding/base64.d.ts +0 -0
- /package/esm/deps/deno.land/{std@0.190.0 → std@0.196.0}/encoding/base64.js +0 -0
- /package/esm/deps/deno.land/{std@0.190.0 → std@0.196.0}/fmt/colors.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.190.0/testing/_diff.d.ts → std@0.196.0/_util/diff.d.ts} +0 -0
- /package/script/deps/deno.land/{std@0.190.0/testing/_diff.js → std@0.196.0/_util/diff.js} +0 -0
- /package/script/deps/deno.land/{std@0.190.0/testing → std@0.196.0/assert}/_format.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.190.0/testing → std@0.196.0/assert}/_format.js +0 -0
- /package/script/deps/deno.land/{std@0.190.0 → std@0.196.0}/encoding/base64.d.ts +0 -0
- /package/script/deps/deno.land/{std@0.190.0 → std@0.196.0}/encoding/base64.js +0 -0
- /package/script/deps/deno.land/{std@0.190.0 → std@0.196.0}/fmt/colors.d.ts +0 -0
package/{esm/deps/deno.land/std@0.190.0 → script/deps/deno.land/std@0.196.0}/testing/asserts.d.ts
RENAMED
|
@@ -1,202 +1,178 @@
|
|
|
1
|
-
export declare class AssertionError extends Error {
|
|
2
|
-
name: string;
|
|
3
|
-
constructor(message: string);
|
|
4
|
-
}
|
|
5
1
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
2
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/mod.ts` instead.
|
|
3
|
+
*
|
|
4
|
+
* A library of assertion functions.
|
|
5
|
+
* If the assertion is false an `AssertionError` will be thrown which will
|
|
6
|
+
* result in pretty-printed diff of failing assertion.
|
|
7
|
+
*
|
|
8
|
+
* This module is browser compatible, but do not rely on good formatting of
|
|
9
|
+
* values for AssertionError messages in browsers.
|
|
10
|
+
*
|
|
11
|
+
* @module
|
|
9
12
|
*/
|
|
10
|
-
export
|
|
11
|
-
/** Make an assertion, error will be thrown if `expr` does not have truthy value. */
|
|
12
|
-
export declare function assert(expr: unknown, msg?: string): asserts expr;
|
|
13
|
-
/** Make an assertion, error will be thrown if `expr` have truthy value. */
|
|
14
|
-
type Falsy = false | 0 | 0n | "" | null | undefined;
|
|
15
|
-
export declare function assertFalse(expr: unknown, msg?: string): asserts expr is Falsy;
|
|
13
|
+
export {
|
|
16
14
|
/**
|
|
17
|
-
*
|
|
18
|
-
* deeply equal, then throw.
|
|
15
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/assert.ts` instead.
|
|
19
16
|
*
|
|
20
|
-
*
|
|
17
|
+
* Make an assertion, error will be thrown if `expr` does not have truthy value.
|
|
18
|
+
*/
|
|
19
|
+
assert,
|
|
20
|
+
/**
|
|
21
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/assert_almost_equals.ts` instead.
|
|
22
|
+
*
|
|
23
|
+
* Make an assertion that `actual` and `expected` are almost equal numbers through
|
|
24
|
+
* a given tolerance. It can be used to take into account IEEE-754 double-precision
|
|
25
|
+
* floating-point representation limitations.
|
|
26
|
+
* If the values are not almost equal then throw.
|
|
21
27
|
*
|
|
22
28
|
* @example
|
|
23
29
|
* ```ts
|
|
24
|
-
* import {
|
|
30
|
+
* import { assertAlmostEquals, assertThrows } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
25
31
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
32
|
+
* assertAlmostEquals(0.1, 0.2);
|
|
33
|
+
*
|
|
34
|
+
* // Using a custom tolerance value
|
|
35
|
+
* assertAlmostEquals(0.1 + 0.2, 0.3, 1e-16);
|
|
36
|
+
* assertThrows(() => assertAlmostEquals(0.1 + 0.2, 0.3, 1e-17));
|
|
30
37
|
* ```
|
|
31
38
|
*/
|
|
32
|
-
|
|
39
|
+
assertAlmostEquals,
|
|
33
40
|
/**
|
|
34
|
-
*
|
|
35
|
-
*
|
|
41
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/assert_array_includes.ts` instead.
|
|
42
|
+
*
|
|
43
|
+
* Make an assertion that `actual` includes the `expected` values.
|
|
44
|
+
* If not then an error will be thrown.
|
|
36
45
|
*
|
|
37
46
|
* Type parameter can be specified to ensure values under comparison have the same type.
|
|
38
47
|
*
|
|
39
48
|
* @example
|
|
40
49
|
* ```ts
|
|
41
|
-
* import {
|
|
50
|
+
* import { assertArrayIncludes } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
42
51
|
*
|
|
43
|
-
*
|
|
52
|
+
* assertArrayIncludes<number>([1, 2], [2])
|
|
44
53
|
* ```
|
|
45
54
|
*/
|
|
46
|
-
|
|
55
|
+
assertArrayIncludes,
|
|
47
56
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
57
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/assert_equals.ts` instead.
|
|
58
|
+
*
|
|
59
|
+
* Make an assertion that `actual` and `expected` are equal, deeply. If not
|
|
60
|
+
* deeply equal, then throw.
|
|
61
|
+
*
|
|
62
|
+
* Type parameter can be specified to ensure values under comparison have the same type.
|
|
50
63
|
*
|
|
51
64
|
* @example
|
|
52
65
|
* ```ts
|
|
53
|
-
* import {
|
|
54
|
-
*
|
|
55
|
-
* Deno.test("isStrictlyEqual", function (): void {
|
|
56
|
-
* const a = {};
|
|
57
|
-
* const b = a;
|
|
58
|
-
* assertStrictEquals(a, b);
|
|
59
|
-
* });
|
|
66
|
+
* import { assertEquals } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
60
67
|
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
* const b = {};
|
|
65
|
-
* assertStrictEquals(a, b);
|
|
68
|
+
* Deno.test("example", function (): void {
|
|
69
|
+
* assertEquals("world", "world");
|
|
70
|
+
* assertEquals({ hello: "world" }, { hello: "world" });
|
|
66
71
|
* });
|
|
67
72
|
* ```
|
|
68
73
|
*/
|
|
69
|
-
|
|
74
|
+
assertEquals,
|
|
70
75
|
/**
|
|
71
|
-
*
|
|
72
|
-
* If the values are strictly equal then throw.
|
|
73
|
-
*
|
|
74
|
-
* ```ts
|
|
75
|
-
* import { assertNotStrictEquals } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
76
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/assert_exists.ts` instead.
|
|
76
77
|
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
78
|
+
* Make an assertion that actual is not null or undefined.
|
|
79
|
+
* If not then throw.
|
|
79
80
|
*/
|
|
80
|
-
|
|
81
|
+
assertExists,
|
|
81
82
|
/**
|
|
82
|
-
*
|
|
83
|
-
* a given tolerance. It can be used to take into account IEEE-754 double-precision
|
|
84
|
-
* floating-point representation limitations.
|
|
85
|
-
* If the values are not almost equal then throw.
|
|
86
|
-
*
|
|
87
|
-
* @example
|
|
88
|
-
* ```ts
|
|
89
|
-
* import { assertAlmostEquals, assertThrows } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
83
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/assert_false.ts` instead.
|
|
90
84
|
*
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
* // Using a custom tolerance value
|
|
94
|
-
* assertAlmostEquals(0.1 + 0.2, 0.3, 1e-16);
|
|
95
|
-
* assertThrows(() => assertAlmostEquals(0.1 + 0.2, 0.3, 1e-17));
|
|
96
|
-
* ```
|
|
85
|
+
* Make an assertion, error will be thrown if `expr` have truthy value.
|
|
97
86
|
*/
|
|
98
|
-
|
|
99
|
-
type AnyConstructor = new (...args: any[]) => any;
|
|
100
|
-
type GetConstructorType<T extends AnyConstructor> = T extends new (...args: any) => infer C ? C : never;
|
|
87
|
+
assertFalse,
|
|
101
88
|
/**
|
|
89
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/assert_instance_of.ts` instead.
|
|
90
|
+
*
|
|
102
91
|
* Make an assertion that `obj` is an instance of `type`.
|
|
103
92
|
* If not then throw.
|
|
104
93
|
*/
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
|
|
108
|
-
* If so, then throw.
|
|
109
|
-
*/
|
|
110
|
-
export declare function assertNotInstanceOf<A, T>(actual: A, unexpectedType: new (...args: any[]) => T, msg?: string): asserts actual is Exclude<A, T>;
|
|
94
|
+
assertInstanceOf,
|
|
95
|
+
/** @deprecated (will be removed after 1.0.0) Import from `std/assert/assertion_error.ts` instead. */
|
|
96
|
+
AssertionError,
|
|
111
97
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
98
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/assert_is_error.ts` instead.
|
|
99
|
+
*
|
|
100
|
+
* Make an assertion that `error` is an `Error`.
|
|
101
|
+
* If not then an error will be thrown.
|
|
102
|
+
* An error class and a string that should be included in the
|
|
103
|
+
* error message can also be asserted.
|
|
114
104
|
*/
|
|
115
|
-
|
|
105
|
+
assertIsError,
|
|
116
106
|
/**
|
|
117
|
-
*
|
|
107
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/assert_match.ts` instead.
|
|
108
|
+
*
|
|
109
|
+
* Make an assertion that `actual` match RegExp `expected`. If not
|
|
118
110
|
* then throw.
|
|
119
111
|
*/
|
|
120
|
-
|
|
112
|
+
assertMatch,
|
|
121
113
|
/**
|
|
122
|
-
*
|
|
123
|
-
*
|
|
114
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/assert_not_equals.ts` instead.
|
|
115
|
+
*
|
|
116
|
+
* Make an assertion that `actual` and `expected` are not equal, deeply.
|
|
117
|
+
* If not then throw.
|
|
124
118
|
*
|
|
125
119
|
* Type parameter can be specified to ensure values under comparison have the same type.
|
|
126
120
|
*
|
|
127
121
|
* @example
|
|
128
122
|
* ```ts
|
|
129
|
-
* import {
|
|
123
|
+
* import { assertNotEquals } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
130
124
|
*
|
|
131
|
-
*
|
|
125
|
+
* assertNotEquals<number>(1, 2)
|
|
132
126
|
* ```
|
|
133
127
|
*/
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Make an assertion that `actual` match RegExp `expected`. If not
|
|
137
|
-
* then throw.
|
|
138
|
-
*/
|
|
139
|
-
export declare function assertMatch(actual: string, expected: RegExp, msg?: string): void;
|
|
128
|
+
assertNotEquals,
|
|
140
129
|
/**
|
|
141
|
-
*
|
|
142
|
-
*
|
|
130
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/assert_not_instance_of.ts` instead.
|
|
131
|
+
*
|
|
132
|
+
* Make an assertion that `obj` is not an instance of `type`.
|
|
133
|
+
* If so, then throw.
|
|
143
134
|
*/
|
|
144
|
-
|
|
135
|
+
assertNotInstanceOf,
|
|
145
136
|
/**
|
|
137
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/assert_not_match.ts` instead.
|
|
138
|
+
*
|
|
146
139
|
* Make an assertion that `actual` object is a subset of `expected` object, deeply.
|
|
147
140
|
* If not, then throw.
|
|
148
141
|
*/
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Forcefully throws a failed assertion
|
|
152
|
-
*/
|
|
153
|
-
export declare function fail(msg?: string): never;
|
|
142
|
+
assertNotMatch,
|
|
154
143
|
/**
|
|
155
|
-
*
|
|
156
|
-
* If not then an error will be thrown.
|
|
157
|
-
* An error class and a string that should be included in the
|
|
158
|
-
* error message can also be asserted.
|
|
159
|
-
*/
|
|
160
|
-
export declare function assertIsError<E extends Error = Error>(error: unknown, ErrorClass?: new (...args: any[]) => E, msgIncludes?: string, msg?: string): asserts error is E;
|
|
161
|
-
/**
|
|
162
|
-
* Executes a function, expecting it to throw. If it does not, then it
|
|
163
|
-
* throws.
|
|
144
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/assert_not_strict_equals.ts` instead.
|
|
164
145
|
*
|
|
165
|
-
*
|
|
166
|
-
*
|
|
167
|
-
* import { assertThrows } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
146
|
+
* Make an assertion that `actual` and `expected` are not strictly equal.
|
|
147
|
+
* If the values are strictly equal then throw.
|
|
168
148
|
*
|
|
169
|
-
*
|
|
170
|
-
*
|
|
171
|
-
* throw new TypeError("hello world!");
|
|
172
|
-
* });
|
|
173
|
-
* });
|
|
149
|
+
* ```ts
|
|
150
|
+
* import { assertNotStrictEquals } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
174
151
|
*
|
|
175
|
-
*
|
|
176
|
-
* Deno.test("fails", function (): void {
|
|
177
|
-
* assertThrows((): void => {
|
|
178
|
-
* console.log("Hello world");
|
|
179
|
-
* });
|
|
180
|
-
* });
|
|
152
|
+
* assertNotStrictEquals(1, 1)
|
|
181
153
|
* ```
|
|
182
154
|
*/
|
|
183
|
-
|
|
155
|
+
assertNotStrictEquals,
|
|
184
156
|
/**
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
|
|
157
|
+
* Make an assertion that `actual` object is a subset of `expected` object, deeply.
|
|
158
|
+
* If not, then throw.
|
|
159
|
+
*/
|
|
160
|
+
assertObjectMatch,
|
|
161
|
+
/**
|
|
162
|
+
* Executes a function which returns a promise, expecting it to reject.
|
|
163
|
+
* If it does not, then it throws. An error class and a string that should be
|
|
164
|
+
* included in the error message can also be asserted.
|
|
188
165
|
*
|
|
189
166
|
* @example
|
|
190
|
-
*
|
|
191
167
|
* ```ts
|
|
192
|
-
* import {
|
|
168
|
+
* import { assertRejects } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
193
169
|
*
|
|
194
|
-
* Deno.test("doesThrow", function ()
|
|
195
|
-
*
|
|
170
|
+
* Deno.test("doesThrow", async function () {
|
|
171
|
+
* await assertRejects(async () => {
|
|
196
172
|
* throw new TypeError("hello world!");
|
|
197
173
|
* }, TypeError);
|
|
198
|
-
*
|
|
199
|
-
* ()
|
|
174
|
+
* await assertRejects(
|
|
175
|
+
* async () => {
|
|
200
176
|
* throw new TypeError("hello world!");
|
|
201
177
|
* },
|
|
202
178
|
* TypeError,
|
|
@@ -205,18 +181,16 @@ export declare function assertThrows(fn: () => unknown, msg?: string): unknown;
|
|
|
205
181
|
* });
|
|
206
182
|
*
|
|
207
183
|
* // This test will not pass.
|
|
208
|
-
* Deno.test("fails", function ()
|
|
209
|
-
*
|
|
210
|
-
*
|
|
211
|
-
*
|
|
184
|
+
* Deno.test("fails", async function () {
|
|
185
|
+
* await assertRejects(
|
|
186
|
+
* async () => {
|
|
187
|
+
* console.log("Hello world");
|
|
188
|
+
* },
|
|
189
|
+
* );
|
|
212
190
|
* });
|
|
213
191
|
* ```
|
|
214
|
-
*/
|
|
215
|
-
export declare function assertThrows<E extends Error = Error>(fn: () => unknown, ErrorClass: new (...args: any[]) => E, msgIncludes?: string, msg?: string): E;
|
|
216
|
-
/**
|
|
217
|
-
* Executes a function which returns a promise, expecting it to reject.
|
|
218
192
|
*
|
|
219
|
-
* @example
|
|
193
|
+
* * @example
|
|
220
194
|
* ```ts
|
|
221
195
|
* import { assertRejects } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
222
196
|
*
|
|
@@ -243,22 +217,56 @@ export declare function assertThrows<E extends Error = Error>(fn: () => unknown,
|
|
|
243
217
|
* });
|
|
244
218
|
* ```
|
|
245
219
|
*/
|
|
246
|
-
|
|
220
|
+
assertRejects,
|
|
247
221
|
/**
|
|
248
|
-
*
|
|
249
|
-
*
|
|
250
|
-
*
|
|
222
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/assert_strict_equals.ts` instead.
|
|
223
|
+
*
|
|
224
|
+
* Make an assertion that `actual` and `expected` are strictly equal. If
|
|
225
|
+
* not then throw.
|
|
251
226
|
*
|
|
252
227
|
* @example
|
|
253
228
|
* ```ts
|
|
254
|
-
* import {
|
|
229
|
+
* import { assertStrictEquals } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
255
230
|
*
|
|
256
|
-
* Deno.test("
|
|
257
|
-
*
|
|
231
|
+
* Deno.test("isStrictlyEqual", function (): void {
|
|
232
|
+
* const a = {};
|
|
233
|
+
* const b = a;
|
|
234
|
+
* assertStrictEquals(a, b);
|
|
235
|
+
* });
|
|
236
|
+
*
|
|
237
|
+
* // This test fails
|
|
238
|
+
* Deno.test("isNotStrictlyEqual", function (): void {
|
|
239
|
+
* const a = {};
|
|
240
|
+
* const b = {};
|
|
241
|
+
* assertStrictEquals(a, b);
|
|
242
|
+
* });
|
|
243
|
+
* ```
|
|
244
|
+
*/
|
|
245
|
+
assertStrictEquals,
|
|
246
|
+
/**
|
|
247
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/assert_string_includes.ts` instead.
|
|
248
|
+
*
|
|
249
|
+
* Make an assertion that actual includes expected. If not
|
|
250
|
+
* then throw.
|
|
251
|
+
*/
|
|
252
|
+
assertStringIncludes,
|
|
253
|
+
/**
|
|
254
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/assert_throws.ts` instead.
|
|
255
|
+
*
|
|
256
|
+
* Executes a function, expecting it to throw. If it does not, then it
|
|
257
|
+
* throws. An error class and a string that should be included in the
|
|
258
|
+
* error message can also be asserted.
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* ```ts
|
|
262
|
+
* import { assertThrows } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
263
|
+
*
|
|
264
|
+
* Deno.test("doesThrow", function (): void {
|
|
265
|
+
* assertThrows((): void => {
|
|
258
266
|
* throw new TypeError("hello world!");
|
|
259
267
|
* }, TypeError);
|
|
260
|
-
*
|
|
261
|
-
*
|
|
268
|
+
* assertThrows(
|
|
269
|
+
* (): void => {
|
|
262
270
|
* throw new TypeError("hello world!");
|
|
263
271
|
* },
|
|
264
272
|
* TypeError,
|
|
@@ -267,18 +275,55 @@ export declare function assertRejects(fn: () => PromiseLike<unknown>, msg?: stri
|
|
|
267
275
|
* });
|
|
268
276
|
*
|
|
269
277
|
* // This test will not pass.
|
|
270
|
-
* Deno.test("fails",
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
* },
|
|
275
|
-
* );
|
|
278
|
+
* Deno.test("fails", function (): void {
|
|
279
|
+
* assertThrows((): void => {
|
|
280
|
+
* console.log("Hello world");
|
|
281
|
+
* });
|
|
276
282
|
* });
|
|
277
283
|
* ```
|
|
284
|
+
*
|
|
285
|
+
* @example
|
|
286
|
+
* ```ts
|
|
287
|
+
* import { assertThrows } from "https://deno.land/std@$STD_VERSION/testing/asserts.ts";
|
|
288
|
+
*
|
|
289
|
+
* Deno.test("doesThrow", function (): void {
|
|
290
|
+
* assertThrows((): void => {
|
|
291
|
+
* throw new TypeError("hello world!");
|
|
292
|
+
* });
|
|
293
|
+
* });
|
|
294
|
+
*
|
|
295
|
+
* // This test will not pass.
|
|
296
|
+
* Deno.test("fails", function (): void {
|
|
297
|
+
* assertThrows((): void => {
|
|
298
|
+
* console.log("Hello world");
|
|
299
|
+
* });
|
|
300
|
+
* });
|
|
301
|
+
* ```
|
|
302
|
+
*/
|
|
303
|
+
assertThrows,
|
|
304
|
+
/**
|
|
305
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/equal.ts` instead.
|
|
306
|
+
*
|
|
307
|
+
* Deep equality comparison used in assertions
|
|
308
|
+
* @param c actual value
|
|
309
|
+
* @param d expected value
|
|
310
|
+
*/
|
|
311
|
+
equal,
|
|
312
|
+
/**
|
|
313
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/fail.ts` instead.
|
|
314
|
+
*
|
|
315
|
+
* Forcefully throws a failed assertion
|
|
316
|
+
*/
|
|
317
|
+
fail,
|
|
318
|
+
/**
|
|
319
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/unimplemented.ts` instead.
|
|
320
|
+
*
|
|
321
|
+
* Use this to stub out methods that will throw when invoked.
|
|
322
|
+
*/
|
|
323
|
+
unimplemented,
|
|
324
|
+
/**
|
|
325
|
+
* @deprecated (will be removed after 1.0.0) Import from `std/assert/unreachable.ts` instead.
|
|
326
|
+
*
|
|
327
|
+
* Use this to assert unreachable code.
|
|
278
328
|
*/
|
|
279
|
-
|
|
280
|
-
/** Use this to stub out methods that will throw when invoked. */
|
|
281
|
-
export declare function unimplemented(msg?: string): never;
|
|
282
|
-
/** Use this to assert unreachable code. */
|
|
283
|
-
export declare function unreachable(): never;
|
|
284
|
-
export {};
|
|
329
|
+
unreachable, } from "../assert/mod.js";
|