bun-types-no-globals 1.2.22-canary.20250908T140620 → 1.2.22-canary.20250910T140559
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/lib/bun.d.ts +1 -0
- package/lib/shell.d.ts +2 -2
- package/lib/sql.d.ts +23 -22
- package/lib/test.d.ts +109 -17
- package/package.json +1 -1
package/lib/bun.d.ts
CHANGED
package/lib/shell.d.ts
CHANGED
|
@@ -58,7 +58,7 @@ declare module "bun" {
|
|
|
58
58
|
* // "bun"
|
|
59
59
|
* ```
|
|
60
60
|
*/
|
|
61
|
-
function env(newEnv?: Record<string, string | undefined>): $;
|
|
61
|
+
function env(newEnv?: Record<string, string | undefined> | NodeJS.Dict<string> | undefined): $;
|
|
62
62
|
|
|
63
63
|
/**
|
|
64
64
|
*
|
|
@@ -106,7 +106,7 @@ declare module "bun" {
|
|
|
106
106
|
* expect(stdout.toString()).toBe("LOL!");
|
|
107
107
|
* ```
|
|
108
108
|
*/
|
|
109
|
-
env(newEnv: Record<string, string> | undefined): this;
|
|
109
|
+
env(newEnv: Record<string, string | undefined> | NodeJS.Dict<string> | undefined): this;
|
|
110
110
|
|
|
111
111
|
/**
|
|
112
112
|
* By default, the shell will write to the current process's stdout and stderr, as well as buffering that output.
|
package/lib/sql.d.ts
CHANGED
|
@@ -41,22 +41,22 @@ declare module "bun" {
|
|
|
41
41
|
|
|
42
42
|
class PostgresError extends SQLError {
|
|
43
43
|
public readonly code: string;
|
|
44
|
-
public readonly errno
|
|
45
|
-
public readonly detail
|
|
46
|
-
public readonly hint
|
|
47
|
-
public readonly severity
|
|
48
|
-
public readonly position
|
|
49
|
-
public readonly internalPosition
|
|
50
|
-
public readonly internalQuery
|
|
51
|
-
public readonly where
|
|
52
|
-
public readonly schema
|
|
53
|
-
public readonly table
|
|
54
|
-
public readonly column
|
|
55
|
-
public readonly dataType
|
|
56
|
-
public readonly constraint
|
|
57
|
-
public readonly file
|
|
58
|
-
public readonly line
|
|
59
|
-
public readonly routine
|
|
44
|
+
public readonly errno?: string | undefined;
|
|
45
|
+
public readonly detail?: string | undefined;
|
|
46
|
+
public readonly hint?: string | undefined;
|
|
47
|
+
public readonly severity?: string | undefined;
|
|
48
|
+
public readonly position?: string | undefined;
|
|
49
|
+
public readonly internalPosition?: string | undefined;
|
|
50
|
+
public readonly internalQuery?: string | undefined;
|
|
51
|
+
public readonly where?: string | undefined;
|
|
52
|
+
public readonly schema?: string | undefined;
|
|
53
|
+
public readonly table?: string | undefined;
|
|
54
|
+
public readonly column?: string | undefined;
|
|
55
|
+
public readonly dataType?: string | undefined;
|
|
56
|
+
public readonly constraint?: string | undefined;
|
|
57
|
+
public readonly file?: string | undefined;
|
|
58
|
+
public readonly line?: string | undefined;
|
|
59
|
+
public readonly routine?: string | undefined;
|
|
60
60
|
|
|
61
61
|
constructor(
|
|
62
62
|
message: string,
|
|
@@ -84,8 +84,8 @@ declare module "bun" {
|
|
|
84
84
|
|
|
85
85
|
class MySQLError extends SQLError {
|
|
86
86
|
public readonly code: string;
|
|
87
|
-
public readonly errno
|
|
88
|
-
public readonly sqlState
|
|
87
|
+
public readonly errno?: number | undefined;
|
|
88
|
+
public readonly sqlState?: string | undefined;
|
|
89
89
|
constructor(message: string, options: { code: string; errno: number | undefined; sqlState: string | undefined });
|
|
90
90
|
}
|
|
91
91
|
|
|
@@ -143,13 +143,13 @@ declare module "bun" {
|
|
|
143
143
|
|
|
144
144
|
/**
|
|
145
145
|
* Database server hostname
|
|
146
|
+
* @deprecated Prefer {@link hostname}
|
|
146
147
|
* @default "localhost"
|
|
147
148
|
*/
|
|
148
149
|
host?: string | undefined;
|
|
149
150
|
|
|
150
151
|
/**
|
|
151
|
-
* Database server hostname
|
|
152
|
-
* @deprecated Prefer {@link host}
|
|
152
|
+
* Database server hostname
|
|
153
153
|
* @default "localhost"
|
|
154
154
|
*/
|
|
155
155
|
hostname?: string | undefined;
|
|
@@ -264,13 +264,14 @@ declare module "bun" {
|
|
|
264
264
|
* Whether to use TLS/SSL for the connection
|
|
265
265
|
* @default false
|
|
266
266
|
*/
|
|
267
|
-
tls?: TLSOptions | boolean | undefined;
|
|
267
|
+
tls?: Bun.BunFile | TLSOptions | boolean | undefined;
|
|
268
268
|
|
|
269
269
|
/**
|
|
270
270
|
* Whether to use TLS/SSL for the connection (alias for tls)
|
|
271
|
+
* @deprecated Prefer {@link tls}
|
|
271
272
|
* @default false
|
|
272
273
|
*/
|
|
273
|
-
ssl?: TLSOptions | boolean | undefined;
|
|
274
|
+
ssl?: Bun.BunFile | TLSOptions | boolean | undefined;
|
|
274
275
|
|
|
275
276
|
/**
|
|
276
277
|
* Unix domain socket path for connection
|
package/lib/test.d.ts
CHANGED
|
@@ -14,11 +14,6 @@
|
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
16
|
declare module "bun:test" {
|
|
17
|
-
/**
|
|
18
|
-
* -- Mocks --
|
|
19
|
-
*
|
|
20
|
-
* @category Testing
|
|
21
|
-
*/
|
|
22
17
|
export type Mock<T extends (...args: any[]) => any> = JestMock.Mock<T>;
|
|
23
18
|
|
|
24
19
|
export const mock: {
|
|
@@ -588,7 +583,9 @@ declare module "bun:test" {
|
|
|
588
583
|
* @param customFailMessage an optional custom message to display if the test fails.
|
|
589
584
|
* */
|
|
590
585
|
|
|
591
|
-
|
|
586
|
+
(actual?: never, customFailMessage?: string): Matchers<undefined>;
|
|
587
|
+
<T = unknown>(actual: T, customFailMessage?: string): Matchers<T>;
|
|
588
|
+
<T = unknown>(actual?: T, customFailMessage?: string): Matchers<T | undefined>;
|
|
592
589
|
|
|
593
590
|
/**
|
|
594
591
|
* Access to negated asymmetric matchers.
|
|
@@ -906,6 +903,7 @@ declare module "bun:test" {
|
|
|
906
903
|
* @param message the message to display if the test fails (optional)
|
|
907
904
|
*/
|
|
908
905
|
pass: (message?: string) => void;
|
|
906
|
+
|
|
909
907
|
/**
|
|
910
908
|
* Assertion which fails.
|
|
911
909
|
*
|
|
@@ -917,6 +915,7 @@ declare module "bun:test" {
|
|
|
917
915
|
* expect().not.fail("hi");
|
|
918
916
|
*/
|
|
919
917
|
fail: (message?: string) => void;
|
|
918
|
+
|
|
920
919
|
/**
|
|
921
920
|
* Asserts that a value equals what is expected.
|
|
922
921
|
*
|
|
@@ -930,9 +929,15 @@ declare module "bun:test" {
|
|
|
930
929
|
* expect([123]).toBe([123]); // fail, use toEqual()
|
|
931
930
|
* expect(3 + 0.14).toBe(3.14); // fail, use toBeCloseTo()
|
|
932
931
|
*
|
|
932
|
+
* // TypeScript errors:
|
|
933
|
+
* expect("hello").toBe(3.14); // typescript error + fail
|
|
934
|
+
* expect("hello").toBe<number>(3.14); // no typescript error, but still fails
|
|
935
|
+
*
|
|
933
936
|
* @param expected the expected value
|
|
934
937
|
*/
|
|
935
938
|
toBe(expected: T): void;
|
|
939
|
+
toBe<X = T>(expected: NoInfer<X>): void;
|
|
940
|
+
|
|
936
941
|
/**
|
|
937
942
|
* Asserts that a number is odd.
|
|
938
943
|
*
|
|
@@ -942,6 +947,7 @@ declare module "bun:test" {
|
|
|
942
947
|
* expect(2).not.toBeOdd();
|
|
943
948
|
*/
|
|
944
949
|
toBeOdd(): void;
|
|
950
|
+
|
|
945
951
|
/**
|
|
946
952
|
* Asserts that a number is even.
|
|
947
953
|
*
|
|
@@ -951,6 +957,7 @@ declare module "bun:test" {
|
|
|
951
957
|
* expect(1).not.toBeEven();
|
|
952
958
|
*/
|
|
953
959
|
toBeEven(): void;
|
|
960
|
+
|
|
954
961
|
/**
|
|
955
962
|
* Asserts that value is close to the expected by floating point precision.
|
|
956
963
|
*
|
|
@@ -969,6 +976,7 @@ declare module "bun:test" {
|
|
|
969
976
|
* @param numDigits the number of digits to check after the decimal point. Default is `2`
|
|
970
977
|
*/
|
|
971
978
|
toBeCloseTo(expected: number, numDigits?: number): void;
|
|
979
|
+
|
|
972
980
|
/**
|
|
973
981
|
* Asserts that a value is deeply equal to what is expected.
|
|
974
982
|
*
|
|
@@ -981,6 +989,8 @@ declare module "bun:test" {
|
|
|
981
989
|
* @param expected the expected value
|
|
982
990
|
*/
|
|
983
991
|
toEqual(expected: T): void;
|
|
992
|
+
toEqual<X = T>(expected: NoInfer<X>): void;
|
|
993
|
+
|
|
984
994
|
/**
|
|
985
995
|
* Asserts that a value is deeply and strictly equal to
|
|
986
996
|
* what is expected.
|
|
@@ -1005,6 +1015,8 @@ declare module "bun:test" {
|
|
|
1005
1015
|
* @param expected the expected value
|
|
1006
1016
|
*/
|
|
1007
1017
|
toStrictEqual(expected: T): void;
|
|
1018
|
+
toStrictEqual<X = T>(expected: NoInfer<X>): void;
|
|
1019
|
+
|
|
1008
1020
|
/**
|
|
1009
1021
|
* Asserts that the value is deep equal to an element in the expected array.
|
|
1010
1022
|
*
|
|
@@ -1017,7 +1029,9 @@ declare module "bun:test" {
|
|
|
1017
1029
|
*
|
|
1018
1030
|
* @param expected the expected value
|
|
1019
1031
|
*/
|
|
1020
|
-
toBeOneOf(expected:
|
|
1032
|
+
toBeOneOf(expected: Iterable<T>): void;
|
|
1033
|
+
toBeOneOf<X = T>(expected: NoInfer<Iterable<X>>): void;
|
|
1034
|
+
|
|
1021
1035
|
/**
|
|
1022
1036
|
* Asserts that a value contains what is expected.
|
|
1023
1037
|
*
|
|
@@ -1031,7 +1045,9 @@ declare module "bun:test" {
|
|
|
1031
1045
|
*
|
|
1032
1046
|
* @param expected the expected value
|
|
1033
1047
|
*/
|
|
1034
|
-
toContain(expected:
|
|
1048
|
+
toContain(expected: T extends Iterable<infer U> ? U : T): void;
|
|
1049
|
+
toContain<X = T>(expected: NoInfer<X extends Iterable<infer U> ? U : X>): void;
|
|
1050
|
+
|
|
1035
1051
|
/**
|
|
1036
1052
|
* Asserts that an `object` contains a key.
|
|
1037
1053
|
*
|
|
@@ -1045,7 +1061,9 @@ declare module "bun:test" {
|
|
|
1045
1061
|
*
|
|
1046
1062
|
* @param expected the expected value
|
|
1047
1063
|
*/
|
|
1048
|
-
toContainKey(expected:
|
|
1064
|
+
toContainKey(expected: keyof T): void;
|
|
1065
|
+
toContainKey<X = T>(expected: NoInfer<keyof X>): void;
|
|
1066
|
+
|
|
1049
1067
|
/**
|
|
1050
1068
|
* Asserts that an `object` contains all the provided keys.
|
|
1051
1069
|
*
|
|
@@ -1060,7 +1078,9 @@ declare module "bun:test" {
|
|
|
1060
1078
|
*
|
|
1061
1079
|
* @param expected the expected value
|
|
1062
1080
|
*/
|
|
1063
|
-
toContainAllKeys(expected:
|
|
1081
|
+
toContainAllKeys(expected: Array<keyof T>): void;
|
|
1082
|
+
toContainAllKeys<X = T>(expected: NoInfer<Array<keyof X>>): void;
|
|
1083
|
+
|
|
1064
1084
|
/**
|
|
1065
1085
|
* Asserts that an `object` contains at least one of the provided keys.
|
|
1066
1086
|
* Asserts that an `object` contains all the provided keys.
|
|
@@ -1075,12 +1095,16 @@ declare module "bun:test" {
|
|
|
1075
1095
|
*
|
|
1076
1096
|
* @param expected the expected value
|
|
1077
1097
|
*/
|
|
1078
|
-
toContainAnyKeys(expected:
|
|
1098
|
+
toContainAnyKeys(expected: Array<keyof T>): void;
|
|
1099
|
+
toContainAnyKeys<X = T>(expected: NoInfer<Array<keyof X>>): void;
|
|
1079
1100
|
|
|
1080
1101
|
/**
|
|
1081
1102
|
* Asserts that an `object` contain the provided value.
|
|
1082
1103
|
*
|
|
1083
|
-
*
|
|
1104
|
+
* This method is deep and will look through child properties to find the
|
|
1105
|
+
* expected value.
|
|
1106
|
+
*
|
|
1107
|
+
* The input value must be an object.
|
|
1084
1108
|
*
|
|
1085
1109
|
* @example
|
|
1086
1110
|
* const shallow = { hello: "world" };
|
|
@@ -1104,11 +1128,16 @@ declare module "bun:test" {
|
|
|
1104
1128
|
*
|
|
1105
1129
|
* @param expected the expected value
|
|
1106
1130
|
*/
|
|
1131
|
+
// Contributor note: In theory we could type this better but it would be a
|
|
1132
|
+
// slow union to compute...
|
|
1107
1133
|
toContainValue(expected: unknown): void;
|
|
1108
1134
|
|
|
1109
1135
|
/**
|
|
1110
1136
|
* Asserts that an `object` contain the provided value.
|
|
1111
1137
|
*
|
|
1138
|
+
* This is the same as {@link toContainValue}, but accepts an array of
|
|
1139
|
+
* values instead.
|
|
1140
|
+
*
|
|
1112
1141
|
* The value must be an object
|
|
1113
1142
|
*
|
|
1114
1143
|
* @example
|
|
@@ -1118,7 +1147,7 @@ declare module "bun:test" {
|
|
|
1118
1147
|
* expect(o).not.toContainValues(['qux', 'foo']);
|
|
1119
1148
|
* @param expected the expected value
|
|
1120
1149
|
*/
|
|
1121
|
-
toContainValues(expected: unknown): void;
|
|
1150
|
+
toContainValues(expected: Array<unknown>): void;
|
|
1122
1151
|
|
|
1123
1152
|
/**
|
|
1124
1153
|
* Asserts that an `object` contain all the provided values.
|
|
@@ -1132,7 +1161,7 @@ declare module "bun:test" {
|
|
|
1132
1161
|
* expect(o).not.toContainAllValues(['bar', 'foo']);
|
|
1133
1162
|
* @param expected the expected value
|
|
1134
1163
|
*/
|
|
1135
|
-
toContainAllValues(expected: unknown): void;
|
|
1164
|
+
toContainAllValues(expected: Array<unknown>): void;
|
|
1136
1165
|
|
|
1137
1166
|
/**
|
|
1138
1167
|
* Asserts that an `object` contain any provided value.
|
|
@@ -1147,7 +1176,7 @@ declare module "bun:test" {
|
|
|
1147
1176
|
* expect(o).not.toContainAnyValues(['qux']);
|
|
1148
1177
|
* @param expected the expected value
|
|
1149
1178
|
*/
|
|
1150
|
-
toContainAnyValues(expected: unknown): void;
|
|
1179
|
+
toContainAnyValues(expected: Array<unknown>): void;
|
|
1151
1180
|
|
|
1152
1181
|
/**
|
|
1153
1182
|
* Asserts that an `object` contains all the provided keys.
|
|
@@ -1159,7 +1188,9 @@ declare module "bun:test" {
|
|
|
1159
1188
|
*
|
|
1160
1189
|
* @param expected the expected value
|
|
1161
1190
|
*/
|
|
1162
|
-
toContainKeys(expected:
|
|
1191
|
+
toContainKeys(expected: Array<keyof T>): void;
|
|
1192
|
+
toContainKeys<X = T>(expected: NoInfer<Array<keyof X>>): void;
|
|
1193
|
+
|
|
1163
1194
|
/**
|
|
1164
1195
|
* Asserts that a value contains and equals what is expected.
|
|
1165
1196
|
*
|
|
@@ -1172,7 +1203,9 @@ declare module "bun:test" {
|
|
|
1172
1203
|
*
|
|
1173
1204
|
* @param expected the expected value
|
|
1174
1205
|
*/
|
|
1175
|
-
toContainEqual(expected:
|
|
1206
|
+
toContainEqual(expected: T extends Iterable<infer U> ? U : T): void;
|
|
1207
|
+
toContainEqual<X = T>(expected: NoInfer<X extends Iterable<infer U> ? U : X>): void;
|
|
1208
|
+
|
|
1176
1209
|
/**
|
|
1177
1210
|
* Asserts that a value has a `.length` property
|
|
1178
1211
|
* that is equal to the expected length.
|
|
@@ -1184,6 +1217,7 @@ declare module "bun:test" {
|
|
|
1184
1217
|
* @param length the expected length
|
|
1185
1218
|
*/
|
|
1186
1219
|
toHaveLength(length: number): void;
|
|
1220
|
+
|
|
1187
1221
|
/**
|
|
1188
1222
|
* Asserts that a value has a property with the
|
|
1189
1223
|
* expected name, and value if provided.
|
|
@@ -1198,6 +1232,7 @@ declare module "bun:test" {
|
|
|
1198
1232
|
* @param value the expected property value, if provided
|
|
1199
1233
|
*/
|
|
1200
1234
|
toHaveProperty(keyPath: string | number | Array<string | number>, value?: unknown): void;
|
|
1235
|
+
|
|
1201
1236
|
/**
|
|
1202
1237
|
* Asserts that a value is "truthy".
|
|
1203
1238
|
*
|
|
@@ -1210,6 +1245,7 @@ declare module "bun:test" {
|
|
|
1210
1245
|
* expect({}).toBeTruthy();
|
|
1211
1246
|
*/
|
|
1212
1247
|
toBeTruthy(): void;
|
|
1248
|
+
|
|
1213
1249
|
/**
|
|
1214
1250
|
* Asserts that a value is "falsy".
|
|
1215
1251
|
*
|
|
@@ -1222,6 +1258,7 @@ declare module "bun:test" {
|
|
|
1222
1258
|
* expect({}).toBeTruthy();
|
|
1223
1259
|
*/
|
|
1224
1260
|
toBeFalsy(): void;
|
|
1261
|
+
|
|
1225
1262
|
/**
|
|
1226
1263
|
* Asserts that a value is defined. (e.g. is not `undefined`)
|
|
1227
1264
|
*
|
|
@@ -1230,6 +1267,7 @@ declare module "bun:test" {
|
|
|
1230
1267
|
* expect(undefined).toBeDefined(); // fail
|
|
1231
1268
|
*/
|
|
1232
1269
|
toBeDefined(): void;
|
|
1270
|
+
|
|
1233
1271
|
/**
|
|
1234
1272
|
* Asserts that the expected value is an instance of value
|
|
1235
1273
|
*
|
|
@@ -1238,6 +1276,7 @@ declare module "bun:test" {
|
|
|
1238
1276
|
* expect(null).toBeInstanceOf(Array); // fail
|
|
1239
1277
|
*/
|
|
1240
1278
|
toBeInstanceOf(value: unknown): void;
|
|
1279
|
+
|
|
1241
1280
|
/**
|
|
1242
1281
|
* Asserts that a value is `undefined`.
|
|
1243
1282
|
*
|
|
@@ -1246,6 +1285,7 @@ declare module "bun:test" {
|
|
|
1246
1285
|
* expect(null).toBeUndefined(); // fail
|
|
1247
1286
|
*/
|
|
1248
1287
|
toBeUndefined(): void;
|
|
1288
|
+
|
|
1249
1289
|
/**
|
|
1250
1290
|
* Asserts that a value is `null`.
|
|
1251
1291
|
*
|
|
@@ -1254,6 +1294,7 @@ declare module "bun:test" {
|
|
|
1254
1294
|
* expect(undefined).toBeNull(); // fail
|
|
1255
1295
|
*/
|
|
1256
1296
|
toBeNull(): void;
|
|
1297
|
+
|
|
1257
1298
|
/**
|
|
1258
1299
|
* Asserts that a value is `NaN`.
|
|
1259
1300
|
*
|
|
@@ -1265,6 +1306,7 @@ declare module "bun:test" {
|
|
|
1265
1306
|
* expect("notanumber").toBeNaN(); // fail
|
|
1266
1307
|
*/
|
|
1267
1308
|
toBeNaN(): void;
|
|
1309
|
+
|
|
1268
1310
|
/**
|
|
1269
1311
|
* Asserts that a value is a `number` and is greater than the expected value.
|
|
1270
1312
|
*
|
|
@@ -1276,6 +1318,7 @@ declare module "bun:test" {
|
|
|
1276
1318
|
* @param expected the expected number
|
|
1277
1319
|
*/
|
|
1278
1320
|
toBeGreaterThan(expected: number | bigint): void;
|
|
1321
|
+
|
|
1279
1322
|
/**
|
|
1280
1323
|
* Asserts that a value is a `number` and is greater than or equal to the expected value.
|
|
1281
1324
|
*
|
|
@@ -1287,6 +1330,7 @@ declare module "bun:test" {
|
|
|
1287
1330
|
* @param expected the expected number
|
|
1288
1331
|
*/
|
|
1289
1332
|
toBeGreaterThanOrEqual(expected: number | bigint): void;
|
|
1333
|
+
|
|
1290
1334
|
/**
|
|
1291
1335
|
* Asserts that a value is a `number` and is less than the expected value.
|
|
1292
1336
|
*
|
|
@@ -1298,6 +1342,7 @@ declare module "bun:test" {
|
|
|
1298
1342
|
* @param expected the expected number
|
|
1299
1343
|
*/
|
|
1300
1344
|
toBeLessThan(expected: number | bigint): void;
|
|
1345
|
+
|
|
1301
1346
|
/**
|
|
1302
1347
|
* Asserts that a value is a `number` and is less than or equal to the expected value.
|
|
1303
1348
|
*
|
|
@@ -1309,6 +1354,7 @@ declare module "bun:test" {
|
|
|
1309
1354
|
* @param expected the expected number
|
|
1310
1355
|
*/
|
|
1311
1356
|
toBeLessThanOrEqual(expected: number | bigint): void;
|
|
1357
|
+
|
|
1312
1358
|
/**
|
|
1313
1359
|
* Asserts that a function throws an error.
|
|
1314
1360
|
*
|
|
@@ -1329,6 +1375,7 @@ declare module "bun:test" {
|
|
|
1329
1375
|
* @param expected the expected error, error message, or error pattern
|
|
1330
1376
|
*/
|
|
1331
1377
|
toThrow(expected?: unknown): void;
|
|
1378
|
+
|
|
1332
1379
|
/**
|
|
1333
1380
|
* Asserts that a function throws an error.
|
|
1334
1381
|
*
|
|
@@ -1350,6 +1397,7 @@ declare module "bun:test" {
|
|
|
1350
1397
|
* @alias toThrow
|
|
1351
1398
|
*/
|
|
1352
1399
|
toThrowError(expected?: unknown): void;
|
|
1400
|
+
|
|
1353
1401
|
/**
|
|
1354
1402
|
* Asserts that a value matches a regular expression or includes a substring.
|
|
1355
1403
|
*
|
|
@@ -1360,6 +1408,7 @@ declare module "bun:test" {
|
|
|
1360
1408
|
* @param expected the expected substring or pattern.
|
|
1361
1409
|
*/
|
|
1362
1410
|
toMatch(expected: string | RegExp): void;
|
|
1411
|
+
|
|
1363
1412
|
/**
|
|
1364
1413
|
* Asserts that a value matches the most recent snapshot.
|
|
1365
1414
|
*
|
|
@@ -1368,6 +1417,7 @@ declare module "bun:test" {
|
|
|
1368
1417
|
* @param hint Hint used to identify the snapshot in the snapshot file.
|
|
1369
1418
|
*/
|
|
1370
1419
|
toMatchSnapshot(hint?: string): void;
|
|
1420
|
+
|
|
1371
1421
|
/**
|
|
1372
1422
|
* Asserts that a value matches the most recent snapshot.
|
|
1373
1423
|
*
|
|
@@ -1380,6 +1430,7 @@ declare module "bun:test" {
|
|
|
1380
1430
|
* @param hint Hint used to identify the snapshot in the snapshot file.
|
|
1381
1431
|
*/
|
|
1382
1432
|
toMatchSnapshot(propertyMatchers?: object, hint?: string): void;
|
|
1433
|
+
|
|
1383
1434
|
/**
|
|
1384
1435
|
* Asserts that a value matches the most recent inline snapshot.
|
|
1385
1436
|
*
|
|
@@ -1390,6 +1441,7 @@ declare module "bun:test" {
|
|
|
1390
1441
|
* @param value The latest automatically-updated snapshot value.
|
|
1391
1442
|
*/
|
|
1392
1443
|
toMatchInlineSnapshot(value?: string): void;
|
|
1444
|
+
|
|
1393
1445
|
/**
|
|
1394
1446
|
* Asserts that a value matches the most recent inline snapshot.
|
|
1395
1447
|
*
|
|
@@ -1405,6 +1457,7 @@ declare module "bun:test" {
|
|
|
1405
1457
|
* @param value The latest automatically-updated snapshot value.
|
|
1406
1458
|
*/
|
|
1407
1459
|
toMatchInlineSnapshot(propertyMatchers?: object, value?: string): void;
|
|
1460
|
+
|
|
1408
1461
|
/**
|
|
1409
1462
|
* Asserts that a function throws an error matching the most recent snapshot.
|
|
1410
1463
|
*
|
|
@@ -1418,6 +1471,7 @@ declare module "bun:test" {
|
|
|
1418
1471
|
* @param value The latest automatically-updated snapshot value.
|
|
1419
1472
|
*/
|
|
1420
1473
|
toThrowErrorMatchingSnapshot(hint?: string): void;
|
|
1474
|
+
|
|
1421
1475
|
/**
|
|
1422
1476
|
* Asserts that a function throws an error matching the most recent snapshot.
|
|
1423
1477
|
*
|
|
@@ -1431,6 +1485,7 @@ declare module "bun:test" {
|
|
|
1431
1485
|
* @param value The latest automatically-updated snapshot value.
|
|
1432
1486
|
*/
|
|
1433
1487
|
toThrowErrorMatchingInlineSnapshot(value?: string): void;
|
|
1488
|
+
|
|
1434
1489
|
/**
|
|
1435
1490
|
* Asserts that an object matches a subset of properties.
|
|
1436
1491
|
*
|
|
@@ -1441,6 +1496,7 @@ declare module "bun:test" {
|
|
|
1441
1496
|
* @param subset Subset of properties to match with.
|
|
1442
1497
|
*/
|
|
1443
1498
|
toMatchObject(subset: object): void;
|
|
1499
|
+
|
|
1444
1500
|
/**
|
|
1445
1501
|
* Asserts that a value is empty.
|
|
1446
1502
|
*
|
|
@@ -1451,6 +1507,7 @@ declare module "bun:test" {
|
|
|
1451
1507
|
* expect(new Set()).toBeEmpty();
|
|
1452
1508
|
*/
|
|
1453
1509
|
toBeEmpty(): void;
|
|
1510
|
+
|
|
1454
1511
|
/**
|
|
1455
1512
|
* Asserts that a value is an empty `object`.
|
|
1456
1513
|
*
|
|
@@ -1459,6 +1516,7 @@ declare module "bun:test" {
|
|
|
1459
1516
|
* expect({ a: 'hello' }).not.toBeEmptyObject();
|
|
1460
1517
|
*/
|
|
1461
1518
|
toBeEmptyObject(): void;
|
|
1519
|
+
|
|
1462
1520
|
/**
|
|
1463
1521
|
* Asserts that a value is `null` or `undefined`.
|
|
1464
1522
|
*
|
|
@@ -1467,6 +1525,7 @@ declare module "bun:test" {
|
|
|
1467
1525
|
* expect(undefined).toBeNil();
|
|
1468
1526
|
*/
|
|
1469
1527
|
toBeNil(): void;
|
|
1528
|
+
|
|
1470
1529
|
/**
|
|
1471
1530
|
* Asserts that a value is a `array`.
|
|
1472
1531
|
*
|
|
@@ -1477,6 +1536,7 @@ declare module "bun:test" {
|
|
|
1477
1536
|
* expect({}).not.toBeArray();
|
|
1478
1537
|
*/
|
|
1479
1538
|
toBeArray(): void;
|
|
1539
|
+
|
|
1480
1540
|
/**
|
|
1481
1541
|
* Asserts that a value is a `array` of a certain length.
|
|
1482
1542
|
*
|
|
@@ -1488,6 +1548,7 @@ declare module "bun:test" {
|
|
|
1488
1548
|
* expect({}).not.toBeArrayOfSize(0);
|
|
1489
1549
|
*/
|
|
1490
1550
|
toBeArrayOfSize(size: number): void;
|
|
1551
|
+
|
|
1491
1552
|
/**
|
|
1492
1553
|
* Asserts that a value is a `boolean`.
|
|
1493
1554
|
*
|
|
@@ -1498,6 +1559,7 @@ declare module "bun:test" {
|
|
|
1498
1559
|
* expect(0).not.toBeBoolean();
|
|
1499
1560
|
*/
|
|
1500
1561
|
toBeBoolean(): void;
|
|
1562
|
+
|
|
1501
1563
|
/**
|
|
1502
1564
|
* Asserts that a value is `true`.
|
|
1503
1565
|
*
|
|
@@ -1507,6 +1569,7 @@ declare module "bun:test" {
|
|
|
1507
1569
|
* expect(1).not.toBeTrue();
|
|
1508
1570
|
*/
|
|
1509
1571
|
toBeTrue(): void;
|
|
1572
|
+
|
|
1510
1573
|
/**
|
|
1511
1574
|
* Asserts that a value matches a specific type.
|
|
1512
1575
|
*
|
|
@@ -1517,6 +1580,7 @@ declare module "bun:test" {
|
|
|
1517
1580
|
* expect([]).not.toBeTypeOf("boolean");
|
|
1518
1581
|
*/
|
|
1519
1582
|
toBeTypeOf(type: "bigint" | "boolean" | "function" | "number" | "object" | "string" | "symbol" | "undefined"): void;
|
|
1583
|
+
|
|
1520
1584
|
/**
|
|
1521
1585
|
* Asserts that a value is `false`.
|
|
1522
1586
|
*
|
|
@@ -1526,6 +1590,7 @@ declare module "bun:test" {
|
|
|
1526
1590
|
* expect(0).not.toBeFalse();
|
|
1527
1591
|
*/
|
|
1528
1592
|
toBeFalse(): void;
|
|
1593
|
+
|
|
1529
1594
|
/**
|
|
1530
1595
|
* Asserts that a value is a `number`.
|
|
1531
1596
|
*
|
|
@@ -1536,6 +1601,7 @@ declare module "bun:test" {
|
|
|
1536
1601
|
* expect(BigInt(1)).not.toBeNumber();
|
|
1537
1602
|
*/
|
|
1538
1603
|
toBeNumber(): void;
|
|
1604
|
+
|
|
1539
1605
|
/**
|
|
1540
1606
|
* Asserts that a value is a `number`, and is an integer.
|
|
1541
1607
|
*
|
|
@@ -1545,6 +1611,7 @@ declare module "bun:test" {
|
|
|
1545
1611
|
* expect(NaN).not.toBeInteger();
|
|
1546
1612
|
*/
|
|
1547
1613
|
toBeInteger(): void;
|
|
1614
|
+
|
|
1548
1615
|
/**
|
|
1549
1616
|
* Asserts that a value is an `object`.
|
|
1550
1617
|
*
|
|
@@ -1554,6 +1621,7 @@ declare module "bun:test" {
|
|
|
1554
1621
|
* expect(NaN).not.toBeObject();
|
|
1555
1622
|
*/
|
|
1556
1623
|
toBeObject(): void;
|
|
1624
|
+
|
|
1557
1625
|
/**
|
|
1558
1626
|
* Asserts that a value is a `number`, and is not `NaN` or `Infinity`.
|
|
1559
1627
|
*
|
|
@@ -1564,6 +1632,7 @@ declare module "bun:test" {
|
|
|
1564
1632
|
* expect(Infinity).not.toBeFinite();
|
|
1565
1633
|
*/
|
|
1566
1634
|
toBeFinite(): void;
|
|
1635
|
+
|
|
1567
1636
|
/**
|
|
1568
1637
|
* Asserts that a value is a positive `number`.
|
|
1569
1638
|
*
|
|
@@ -1573,6 +1642,7 @@ declare module "bun:test" {
|
|
|
1573
1642
|
* expect(NaN).not.toBePositive();
|
|
1574
1643
|
*/
|
|
1575
1644
|
toBePositive(): void;
|
|
1645
|
+
|
|
1576
1646
|
/**
|
|
1577
1647
|
* Asserts that a value is a negative `number`.
|
|
1578
1648
|
*
|
|
@@ -1582,6 +1652,7 @@ declare module "bun:test" {
|
|
|
1582
1652
|
* expect(NaN).not.toBeNegative();
|
|
1583
1653
|
*/
|
|
1584
1654
|
toBeNegative(): void;
|
|
1655
|
+
|
|
1585
1656
|
/**
|
|
1586
1657
|
* Asserts that a value is a number between a start and end value.
|
|
1587
1658
|
*
|
|
@@ -1589,6 +1660,7 @@ declare module "bun:test" {
|
|
|
1589
1660
|
* @param end the end number (exclusive)
|
|
1590
1661
|
*/
|
|
1591
1662
|
toBeWithin(start: number, end: number): void;
|
|
1663
|
+
|
|
1592
1664
|
/**
|
|
1593
1665
|
* Asserts that a value is equal to the expected string, ignoring any whitespace.
|
|
1594
1666
|
*
|
|
@@ -1599,6 +1671,7 @@ declare module "bun:test" {
|
|
|
1599
1671
|
* @param expected the expected string
|
|
1600
1672
|
*/
|
|
1601
1673
|
toEqualIgnoringWhitespace(expected: string): void;
|
|
1674
|
+
|
|
1602
1675
|
/**
|
|
1603
1676
|
* Asserts that a value is a `symbol`.
|
|
1604
1677
|
*
|
|
@@ -1607,6 +1680,7 @@ declare module "bun:test" {
|
|
|
1607
1680
|
* expect("foo").not.toBeSymbol();
|
|
1608
1681
|
*/
|
|
1609
1682
|
toBeSymbol(): void;
|
|
1683
|
+
|
|
1610
1684
|
/**
|
|
1611
1685
|
* Asserts that a value is a `function`.
|
|
1612
1686
|
*
|
|
@@ -1614,6 +1688,7 @@ declare module "bun:test" {
|
|
|
1614
1688
|
* expect(() => {}).toBeFunction();
|
|
1615
1689
|
*/
|
|
1616
1690
|
toBeFunction(): void;
|
|
1691
|
+
|
|
1617
1692
|
/**
|
|
1618
1693
|
* Asserts that a value is a `Date` object.
|
|
1619
1694
|
*
|
|
@@ -1625,6 +1700,7 @@ declare module "bun:test" {
|
|
|
1625
1700
|
* expect("2020-03-01").not.toBeDate();
|
|
1626
1701
|
*/
|
|
1627
1702
|
toBeDate(): void;
|
|
1703
|
+
|
|
1628
1704
|
/**
|
|
1629
1705
|
* Asserts that a value is a valid `Date` object.
|
|
1630
1706
|
*
|
|
@@ -1634,6 +1710,7 @@ declare module "bun:test" {
|
|
|
1634
1710
|
* expect("2020-03-01").not.toBeValidDate();
|
|
1635
1711
|
*/
|
|
1636
1712
|
toBeValidDate(): void;
|
|
1713
|
+
|
|
1637
1714
|
/**
|
|
1638
1715
|
* Asserts that a value is a `string`.
|
|
1639
1716
|
*
|
|
@@ -1643,6 +1720,7 @@ declare module "bun:test" {
|
|
|
1643
1720
|
* expect(123).not.toBeString();
|
|
1644
1721
|
*/
|
|
1645
1722
|
toBeString(): void;
|
|
1723
|
+
|
|
1646
1724
|
/**
|
|
1647
1725
|
* Asserts that a value includes a `string`.
|
|
1648
1726
|
*
|
|
@@ -1651,12 +1729,14 @@ declare module "bun:test" {
|
|
|
1651
1729
|
* @param expected the expected substring
|
|
1652
1730
|
*/
|
|
1653
1731
|
toInclude(expected: string): void;
|
|
1732
|
+
|
|
1654
1733
|
/**
|
|
1655
1734
|
* Asserts that a value includes a `string` {times} times.
|
|
1656
1735
|
* @param expected the expected substring
|
|
1657
1736
|
* @param times the number of times the substring should occur
|
|
1658
1737
|
*/
|
|
1659
1738
|
toIncludeRepeated(expected: string, times: number): void;
|
|
1739
|
+
|
|
1660
1740
|
/**
|
|
1661
1741
|
* Checks whether a value satisfies a custom condition.
|
|
1662
1742
|
* @param {Function} predicate - The custom condition to be satisfied. It should be a function that takes a value as an argument (in this case the value from expect) and returns a boolean.
|
|
@@ -1668,18 +1748,21 @@ declare module "bun:test" {
|
|
|
1668
1748
|
* @link https://jest-extended.jestcommunity.dev/docs/matchers/toSatisfy
|
|
1669
1749
|
*/
|
|
1670
1750
|
toSatisfy(predicate: (value: T) => boolean): void;
|
|
1751
|
+
|
|
1671
1752
|
/**
|
|
1672
1753
|
* Asserts that a value starts with a `string`.
|
|
1673
1754
|
*
|
|
1674
1755
|
* @param expected the string to start with
|
|
1675
1756
|
*/
|
|
1676
1757
|
toStartWith(expected: string): void;
|
|
1758
|
+
|
|
1677
1759
|
/**
|
|
1678
1760
|
* Asserts that a value ends with a `string`.
|
|
1679
1761
|
*
|
|
1680
1762
|
* @param expected the string to end with
|
|
1681
1763
|
*/
|
|
1682
1764
|
toEndWith(expected: string): void;
|
|
1765
|
+
|
|
1683
1766
|
/**
|
|
1684
1767
|
* Ensures that a mock function has returned successfully at least once.
|
|
1685
1768
|
*
|
|
@@ -1720,42 +1803,51 @@ declare module "bun:test" {
|
|
|
1720
1803
|
* Ensures that a mock function is called.
|
|
1721
1804
|
*/
|
|
1722
1805
|
toHaveBeenCalled(): void;
|
|
1806
|
+
|
|
1723
1807
|
/**
|
|
1724
1808
|
* Ensures that a mock function is called an exact number of times.
|
|
1725
1809
|
* @alias toHaveBeenCalled
|
|
1726
1810
|
*/
|
|
1727
1811
|
toBeCalled(): void;
|
|
1812
|
+
|
|
1728
1813
|
/**
|
|
1729
1814
|
* Ensures that a mock function is called an exact number of times.
|
|
1730
1815
|
*/
|
|
1731
1816
|
toHaveBeenCalledTimes(expected: number): void;
|
|
1817
|
+
|
|
1732
1818
|
/**
|
|
1733
1819
|
* Ensure that a mock function is called with specific arguments.
|
|
1734
1820
|
* @alias toHaveBeenCalledTimes
|
|
1735
1821
|
*/
|
|
1736
1822
|
toBeCalledTimes(expected: number): void;
|
|
1823
|
+
|
|
1737
1824
|
/**
|
|
1738
1825
|
* Ensure that a mock function is called with specific arguments.
|
|
1739
1826
|
*/
|
|
1740
1827
|
toHaveBeenCalledWith(...expected: unknown[]): void;
|
|
1828
|
+
|
|
1741
1829
|
/**
|
|
1742
1830
|
* Ensure that a mock function is called with specific arguments.
|
|
1743
1831
|
* @alias toHaveBeenCalledWith
|
|
1744
1832
|
*/
|
|
1745
1833
|
toBeCalledWith(...expected: unknown[]): void;
|
|
1834
|
+
|
|
1746
1835
|
/**
|
|
1747
1836
|
* Ensure that a mock function is called with specific arguments for the last call.
|
|
1748
1837
|
*/
|
|
1749
1838
|
toHaveBeenLastCalledWith(...expected: unknown[]): void;
|
|
1839
|
+
|
|
1750
1840
|
/**
|
|
1751
1841
|
* Ensure that a mock function is called with specific arguments for the nth call.
|
|
1752
1842
|
* @alias toHaveBeenCalledWith
|
|
1753
1843
|
*/
|
|
1754
1844
|
lastCalledWith(...expected: unknown[]): void;
|
|
1845
|
+
|
|
1755
1846
|
/**
|
|
1756
1847
|
* Ensure that a mock function is called with specific arguments for the nth call.
|
|
1757
1848
|
*/
|
|
1758
1849
|
toHaveBeenNthCalledWith(n: number, ...expected: unknown[]): void;
|
|
1850
|
+
|
|
1759
1851
|
/**
|
|
1760
1852
|
* Ensure that a mock function is called with specific arguments for the nth call.
|
|
1761
1853
|
* @alias toHaveBeenCalledWith
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bun-types-no-globals",
|
|
3
|
-
"version": "1.2.22-canary.
|
|
3
|
+
"version": "1.2.22-canary.20250910T140559",
|
|
4
4
|
"main": "./generator/index.ts",
|
|
5
5
|
"types": "./lib/index.d.ts",
|
|
6
6
|
"description": "TypeScript type definitions for Bun without global types pollution",
|