tape-six 1.1.0 → 1.1.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.
- package/README.md +1 -0
- package/index.d.ts +714 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -236,6 +236,7 @@ See [set-up tests](https://github.com/uhop/tape-six/wiki/Set-up-tests) for detai
|
|
|
236
236
|
|
|
237
237
|
The most recent releases:
|
|
238
238
|
|
|
239
|
+
- 1.1.1 _Technical re-release with the missing `index.d.ts` file._
|
|
239
240
|
- 1.1.0 _Added TypeScript support._
|
|
240
241
|
- 1.0.4 _Bugfix for platform-specific tests, old platforms, minor updates to accommodate Deno 2, updated dev deps._
|
|
241
242
|
- 1.0.3 _Minor update to accommodate changes in Bun and updated dev deps._
|
package/index.d.ts
ADDED
|
@@ -0,0 +1,714 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Test options
|
|
3
|
+
*/
|
|
4
|
+
export declare interface TestOptions {
|
|
5
|
+
/**
|
|
6
|
+
* The name of the test
|
|
7
|
+
*/
|
|
8
|
+
name?: string;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* The test function
|
|
12
|
+
*/
|
|
13
|
+
testFn?:
|
|
14
|
+
| ((t: Test) => void | Promise<void>)
|
|
15
|
+
| ((t: Test, resolve: () => void, reject: (error: unknown) => void) => void);
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Skips the test. The test will not be run.
|
|
19
|
+
*/
|
|
20
|
+
skip?: boolean;
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Marks the test as a TODO. The test can fail or pass and does not count towards the test suite's result.
|
|
24
|
+
*/
|
|
25
|
+
todo?: boolean;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* The timeout for the test in milliseconds. If the test takes longer than this, it will be stopped.
|
|
29
|
+
* If not specified, no timeout is used for the test.
|
|
30
|
+
*/
|
|
31
|
+
timeout?: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Test interface
|
|
36
|
+
*/
|
|
37
|
+
export declare interface Test {
|
|
38
|
+
/**
|
|
39
|
+
* A symbol that can be used to match any value.
|
|
40
|
+
*/
|
|
41
|
+
any: Symbol;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* A symbol that can be used to match any value. An alias of `any`.
|
|
45
|
+
*/
|
|
46
|
+
_: Symbol;
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Plans the number of assertions that will be run. Unused.
|
|
50
|
+
* @param n - The number of assertions
|
|
51
|
+
*/
|
|
52
|
+
plan(n: number): void;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Adds a comment to the test. It is shown in the output, but does not affect the test result.
|
|
56
|
+
* @param msg - The comment message
|
|
57
|
+
*/
|
|
58
|
+
comment(msg: string): void;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Skips the test. The test will not be run.
|
|
62
|
+
* @param args - Optional arguments. The last string argument can be a message.
|
|
63
|
+
*/
|
|
64
|
+
skipTest(...args: any[]): void;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Stops the test suite. No more tests will be run.
|
|
68
|
+
* @param msg - Optional message to display
|
|
69
|
+
*/
|
|
70
|
+
bailOut(msg?: string): void;
|
|
71
|
+
|
|
72
|
+
// lifted from `test()`
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Creates a new embedded test with the given name and function.
|
|
76
|
+
* @param name - The name of the test
|
|
77
|
+
* @param fn - The test function
|
|
78
|
+
*/
|
|
79
|
+
test(name: string, fn: (t: Test) => void | Promise<void>): Promise<void>;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Creates a new embedded test with the given function.
|
|
83
|
+
* @param fn - The test function
|
|
84
|
+
*/
|
|
85
|
+
test(fn: (t: Test) => void | Promise<void>): Promise<void>;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Creates a new embedded test with the given options.
|
|
89
|
+
*/
|
|
90
|
+
test(options: TestOptions): Promise<void>;
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Creates a new embedded test with the given options and function.
|
|
94
|
+
* @param options - The test options
|
|
95
|
+
* @param fn - The test function
|
|
96
|
+
*/
|
|
97
|
+
test(options: TestOptions, fn: (t: Test) => void | Promise<void>): Promise<void>;
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Skips the test. The test will not be run.
|
|
101
|
+
* @param name - The name of the test
|
|
102
|
+
* @param fn - The test function
|
|
103
|
+
*/
|
|
104
|
+
skip(name: string, fn: (t: Test) => void | Promise<void>): Promise<void>;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Skips the test. The test will not be run.
|
|
108
|
+
* @param fn - The test function
|
|
109
|
+
*/
|
|
110
|
+
skip(fn: (t: Test) => void | Promise<void>): Promise<void>;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* Skips the test. The test will not be run.
|
|
114
|
+
* @param options - The test options
|
|
115
|
+
*/
|
|
116
|
+
skip(options: TestOptions): Promise<void>;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* Skips the test. The test will not be run.
|
|
120
|
+
* @param options - The test options
|
|
121
|
+
* @param fn - The test function
|
|
122
|
+
*/
|
|
123
|
+
skip(options: TestOptions, fn: (t: Test) => void | Promise<void>): Promise<void>;
|
|
124
|
+
|
|
125
|
+
/**
|
|
126
|
+
* Creates a new embedded test with the given name and function.
|
|
127
|
+
* It is a TODO test, which can fail or pass and does not count towards the test suite's result.
|
|
128
|
+
* @param name - The name of the test
|
|
129
|
+
* @param fn - The test function
|
|
130
|
+
*/
|
|
131
|
+
todo(name: string, fn: (t: Test) => void | Promise<void>): Promise<void>;
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Creates a new embedded test with the given function.
|
|
135
|
+
* It is a TODO test, which can fail or pass and does not count towards the test suite's result.
|
|
136
|
+
* @param fn - The test function
|
|
137
|
+
*/
|
|
138
|
+
todo(fn: (t: Test) => void | Promise<void>): Promise<void>;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* Creates a new embedded test with the given options.
|
|
142
|
+
* It is a TODO test, which can fail or pass and does not count towards the test suite's result.
|
|
143
|
+
* @param options - The test options
|
|
144
|
+
*/
|
|
145
|
+
todo(options: TestOptions): Promise<void>;
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Creates a new embedded test with the given name and function.
|
|
149
|
+
* It is a TODO test, which can fail or pass and does not count towards the test suite's result.
|
|
150
|
+
* @param options - The test options
|
|
151
|
+
* @param fn - The test function
|
|
152
|
+
*/
|
|
153
|
+
todo(options: TestOptions, fn: (t: Test) => void | Promise<void>): Promise<void>;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Runs non-asynchronous callback-based test.
|
|
157
|
+
* @param name - The name of the test
|
|
158
|
+
* @param fn - The test function
|
|
159
|
+
*/
|
|
160
|
+
asPromise(
|
|
161
|
+
name: string,
|
|
162
|
+
fn: (t: Test, resolve: () => void, reject: (error: unknown) => void) => void
|
|
163
|
+
): Promise<void>;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Runs non-asynchronous callback-based test.
|
|
167
|
+
* @param fn - The test function
|
|
168
|
+
*/
|
|
169
|
+
asPromise(
|
|
170
|
+
fn: (t: Test, resolve: () => void, reject: (error: unknown) => void) => void
|
|
171
|
+
): Promise<void>;
|
|
172
|
+
|
|
173
|
+
/**
|
|
174
|
+
* Runs non-asynchronous callback-based test.
|
|
175
|
+
* @param options - The test options
|
|
176
|
+
*/
|
|
177
|
+
asPromise(options: TestOptions): Promise<void>;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Runs non-asynchronous callback-based test.
|
|
181
|
+
* @param options - The test options
|
|
182
|
+
* @param fn - The test function
|
|
183
|
+
*/
|
|
184
|
+
asPromise(
|
|
185
|
+
options: TestOptions,
|
|
186
|
+
fn: (t: Test, resolve: () => void, reject: (error: unknown) => void) => void
|
|
187
|
+
): Promise<void>;
|
|
188
|
+
|
|
189
|
+
// asserts
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Asserts that the test passed.
|
|
193
|
+
* @param msg - Optional message to display if the assertion fails
|
|
194
|
+
*/
|
|
195
|
+
pass(msg?: string): void;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Asserts that the test failed.
|
|
199
|
+
* @param msg - Optional message to display if the assertion fails
|
|
200
|
+
*/
|
|
201
|
+
fail(msg?: string): void;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Asserts that `value` is truthy.
|
|
205
|
+
* @param value - The value to test
|
|
206
|
+
* @param message - Optional message to display if the assertion fails
|
|
207
|
+
*/
|
|
208
|
+
ok(value: unknown, message?: string): void;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Asserts that `value` is not truthy.
|
|
212
|
+
* @param value - The value to test
|
|
213
|
+
* @param message - Optional message to display if the assertion fails
|
|
214
|
+
*/
|
|
215
|
+
notOk(value: unknown, message?: string): void;
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Asserts that `error` is an error and fails the test.
|
|
219
|
+
* @param error - The error to test
|
|
220
|
+
* @param message - Optional message to display if the assertion fails
|
|
221
|
+
*/
|
|
222
|
+
error(error: Error | null | unknown, message?: string): void;
|
|
223
|
+
|
|
224
|
+
/**
|
|
225
|
+
* Asserts that `actual` is strictly equal to `expected`. Uses `===` comparison.
|
|
226
|
+
* @param actual - The actual value
|
|
227
|
+
* @param expected - The expected value
|
|
228
|
+
* @param message - Optional message to display if the assertion fails
|
|
229
|
+
*/
|
|
230
|
+
strictEqual(actual: unknown, expected: unknown, message?: string): void;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Asserts that `actual` is not strictly equal to `expected`. Uses `!==` comparison.
|
|
234
|
+
* @param actual - The actual value
|
|
235
|
+
* @param expected - The expected value
|
|
236
|
+
* @param message - Optional message to display if the assertion fails
|
|
237
|
+
*/
|
|
238
|
+
notStrictEqual(actual: unknown, expected: unknown, message?: string): void;
|
|
239
|
+
|
|
240
|
+
/**
|
|
241
|
+
* Asserts that `actual` is loosely equal to `expected`. Uses `==` comparison.
|
|
242
|
+
* @param actual - The actual value
|
|
243
|
+
* @param expected - The expected value
|
|
244
|
+
* @param message - Optional message to display if the assertion fails
|
|
245
|
+
*/
|
|
246
|
+
looseEqual(actual: unknown, expected: unknown, message?: string): void;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Asserts that `actual` is not loosely equal to `expected`. Uses `!=` comparison.
|
|
250
|
+
* @param actual - The actual value
|
|
251
|
+
* @param expected - The expected value
|
|
252
|
+
* @param message - Optional message to display if the assertion fails
|
|
253
|
+
*/
|
|
254
|
+
notLooseEqual(actual: unknown, expected: unknown, message?: string): void;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Asserts that `actual` is deeply equal to `expected`. Uses strict comparison.
|
|
258
|
+
* @param actual - The actual value
|
|
259
|
+
* @param expected - The expected value
|
|
260
|
+
* @param message - Optional message to display if the assertion fails
|
|
261
|
+
*/
|
|
262
|
+
deepEqual(actual: unknown, expected: unknown, message?: string): void;
|
|
263
|
+
|
|
264
|
+
/**
|
|
265
|
+
* Asserts that `actual` is not deeply equal to `expected`. Uses strict comparison.
|
|
266
|
+
* @param actual - The actual value
|
|
267
|
+
* @param expected - The expected value
|
|
268
|
+
* @param message - Optional message to display if the assertion fails
|
|
269
|
+
*/
|
|
270
|
+
notDeepEqual(actual: unknown, expected: unknown, message?: string): void;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Asserts that `actual` is deeply equal to `expected`. Uses loose comparison.
|
|
274
|
+
* @param actual - The actual value
|
|
275
|
+
* @param expected - The expected value
|
|
276
|
+
* @param message - Optional message to display if the assertion fails
|
|
277
|
+
*/
|
|
278
|
+
deepLooseEqual(actual: unknown, expected: unknown, message?: string): void;
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* Asserts that `actual` is not deeply equal to `expected`. Uses loose comparison.
|
|
282
|
+
* @param actual - The actual value
|
|
283
|
+
* @param expected - The expected value
|
|
284
|
+
* @param message - Optional message to display if the assertion fails
|
|
285
|
+
*/
|
|
286
|
+
notDeepLooseEqual(actual: unknown, expected: unknown, message?: string): void;
|
|
287
|
+
|
|
288
|
+
/**
|
|
289
|
+
* Asserts that `fn` throws an error.
|
|
290
|
+
* @param fn - The function to test
|
|
291
|
+
* @param message - Optional message to display if the assertion fails
|
|
292
|
+
*/
|
|
293
|
+
throws(fn: () => void, message?: string): void;
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* Asserts that `fn` does not throw an error.
|
|
297
|
+
* @param fn - The function to test
|
|
298
|
+
* @param message - Optional message to display if the assertion fails
|
|
299
|
+
*/
|
|
300
|
+
doesNotThrow(fn: () => void, message?: string): void;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Asserts that `string` matches the regular expression `regexp`.
|
|
304
|
+
* @param string - The string to test
|
|
305
|
+
* @param regexp - The regular expression to test against
|
|
306
|
+
* @param message - Optional message to display if the assertion fails
|
|
307
|
+
*/
|
|
308
|
+
matchString(string: string, regexp: RegExp, message?: string): void;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Asserts that `string` does not match the regular expression `regexp`.
|
|
312
|
+
* @param string - The string to test
|
|
313
|
+
* @param regexp - The regular expression to test against
|
|
314
|
+
* @param message - Optional message to display if the assertion fails
|
|
315
|
+
*/
|
|
316
|
+
doesNotMatchString(string: string, regexp: RegExp, message?: string): void;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Asserts that `actual` matches `expected`. This is a structural object comparison.
|
|
320
|
+
* @param actual - The actual value
|
|
321
|
+
* @param expected - The expected value
|
|
322
|
+
* @param message - Optional message to display if the assertion fails
|
|
323
|
+
*/
|
|
324
|
+
match(actual: unknown, expected: unknown, message?: string): void;
|
|
325
|
+
|
|
326
|
+
/**
|
|
327
|
+
* Asserts that `actual` does not match `expected`. This is a structural object comparison.
|
|
328
|
+
* @param actual - The actual value
|
|
329
|
+
* @param expected - The expected value
|
|
330
|
+
* @param message - Optional message to display if the assertion fails
|
|
331
|
+
*/
|
|
332
|
+
doesNotMatch(actual: unknown, expected: unknown, message?: string): void;
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* Asserts that `promise` is rejected.
|
|
336
|
+
* @param promise - The promise to test
|
|
337
|
+
* @param message - Optional message to display if the assertion fails
|
|
338
|
+
*/
|
|
339
|
+
rejects(promise: Promise<unknown>, message?: string): Promise<void>;
|
|
340
|
+
|
|
341
|
+
/**
|
|
342
|
+
* Asserts that `promise` is resolved.
|
|
343
|
+
* @param promise - The promise to test
|
|
344
|
+
* @param message - Optional message to display if the assertion fails
|
|
345
|
+
*/
|
|
346
|
+
resolves(promise: Promise<unknown>, message?: string): Promise<void>;
|
|
347
|
+
|
|
348
|
+
// aliases
|
|
349
|
+
|
|
350
|
+
/**
|
|
351
|
+
* Asserts that `value` is truthy. Alias of `ok`.
|
|
352
|
+
* @param value - The value to test
|
|
353
|
+
* @param message - Optional message to display if the assertion fails
|
|
354
|
+
*/
|
|
355
|
+
true(value: unknown, message?: string): void;
|
|
356
|
+
|
|
357
|
+
/**
|
|
358
|
+
* Asserts that `value` is truthy. Alias of `ok`.
|
|
359
|
+
* @param value - The value to test
|
|
360
|
+
* @param message - Optional message to display if the assertion fails
|
|
361
|
+
*/
|
|
362
|
+
assert(value: unknown, message?: string): void;
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Asserts that `value` is falsy. Alias of `notOk`.
|
|
366
|
+
* @param value - The value to test
|
|
367
|
+
* @param message - Optional message to display if the assertion fails
|
|
368
|
+
*/
|
|
369
|
+
false(value: unknown, message?: string): void;
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* Asserts that `value` is not truthy. Alias of `notOk`.
|
|
373
|
+
* @param value - The value to test
|
|
374
|
+
* @param message - Optional message to display if the assertion fails
|
|
375
|
+
*/
|
|
376
|
+
notok(value: unknown, message?: string): void;
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* Asserts that `error` is an error and fails the test. Alias of `error`.
|
|
380
|
+
* @param error - The error to test
|
|
381
|
+
* @param message - Optional message to display if the assertion fails
|
|
382
|
+
*/
|
|
383
|
+
ifError(error: Error | null | unknown, message?: string): void;
|
|
384
|
+
|
|
385
|
+
/**
|
|
386
|
+
* Asserts that `error` is an error and fails the test. Alias of `error`.
|
|
387
|
+
* @param error - The error to test
|
|
388
|
+
* @param message - Optional message to display if the assertion fails
|
|
389
|
+
*/
|
|
390
|
+
ifErr(error: Error | null | unknown, message?: string): void;
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Asserts that `error` is an error and fails the test. Alias of `error`.
|
|
394
|
+
* @param error - The error to test
|
|
395
|
+
* @param message - Optional message to display if the assertion fails
|
|
396
|
+
*/
|
|
397
|
+
iferror(error: Error | null | unknown, message?: string): void;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Asserts that `a` is strictly equal to `b`. Alias of `strictEqual`.
|
|
401
|
+
* @param a - The first value
|
|
402
|
+
* @param b - The second value
|
|
403
|
+
* @param message - Optional message to display if the assertion fails
|
|
404
|
+
*/
|
|
405
|
+
is(a: unknown, b: unknown, message?: string): void;
|
|
406
|
+
|
|
407
|
+
/**
|
|
408
|
+
* Asserts that `actual` is deeply equal to `expected`. Alias of `strictEqual`.
|
|
409
|
+
* @param actual - The actual value
|
|
410
|
+
* @param expected - The expected value
|
|
411
|
+
* @param message - Optional message to display if the assertion fails
|
|
412
|
+
*/
|
|
413
|
+
equal(actual: unknown, expected: unknown, message?: string): void;
|
|
414
|
+
|
|
415
|
+
/**
|
|
416
|
+
* Asserts that `actual` is strictly equal to `expected`. Alias of `strictEqual`.
|
|
417
|
+
* @param actual - The actual value
|
|
418
|
+
* @param expected - The expected value
|
|
419
|
+
* @param message - Optional message to display if the assertion fails
|
|
420
|
+
*/
|
|
421
|
+
equals(actual: unknown, expected: unknown, message?: string): void;
|
|
422
|
+
|
|
423
|
+
/**
|
|
424
|
+
* Asserts that `actual` is strictly equal to `expected`. Alias of `strictEqual`.
|
|
425
|
+
* @param actual - The actual value
|
|
426
|
+
* @param expected - The expected value
|
|
427
|
+
* @param message - Optional message to display if the assertion fails
|
|
428
|
+
*/
|
|
429
|
+
isEqual(actual: unknown, expected: unknown, message?: string): void;
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Asserts that `actual` is strictly equal to `expected`. Alias of `strictEqual`.
|
|
433
|
+
* @param actual - The actual value
|
|
434
|
+
* @param expected - The expected value
|
|
435
|
+
* @param message - Optional message to display if the assertion fails
|
|
436
|
+
*/
|
|
437
|
+
strictEquals(actual: unknown, expected: unknown, message?: string): void;
|
|
438
|
+
|
|
439
|
+
/**
|
|
440
|
+
* Asserts that `actual` is not equal to `expected`. Alias of `notStrictEqual`.
|
|
441
|
+
* @param actual - The actual value
|
|
442
|
+
* @param expected - The expected value
|
|
443
|
+
* @param message - Optional message to display if the assertion fails
|
|
444
|
+
*/
|
|
445
|
+
not(actual: unknown, expected: unknown, message?: string): void;
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* Asserts that `actual` is not equal to `expected`. Alias of `notStrictEqual`.
|
|
449
|
+
* @param actual - The actual value
|
|
450
|
+
* @param expected - The expected value
|
|
451
|
+
* @param message - Optional message to display if the assertion fails
|
|
452
|
+
*/
|
|
453
|
+
notEqual(actual: unknown, expected: unknown, message?: string): void;
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Asserts that `actual` is not equal to `expected`. Alias of `notStrictEqual`.
|
|
457
|
+
* @param actual - The actual value
|
|
458
|
+
* @param expected - The expected value
|
|
459
|
+
* @param message - Optional message to display if the assertion fails
|
|
460
|
+
*/
|
|
461
|
+
notEquals(actual: unknown, expected: unknown, message?: string): void;
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* Asserts that `actual` is not equal to `expected`. Alias of `notStrictEqual`.
|
|
465
|
+
* @param actual - The actual value
|
|
466
|
+
* @param expected - The expected value
|
|
467
|
+
* @param message - Optional message to display if the assertion fails
|
|
468
|
+
*/
|
|
469
|
+
isNotEqual(actual: unknown, expected: unknown, message?: string): void;
|
|
470
|
+
|
|
471
|
+
/**
|
|
472
|
+
* Asserts that `actual` is not equal to `expected`. Alias of `notStrictEqual`.
|
|
473
|
+
* @param actual - The actual value
|
|
474
|
+
* @param expected - The expected value
|
|
475
|
+
* @param message - Optional message to display if the assertion fails
|
|
476
|
+
*/
|
|
477
|
+
doesNotEqual(actual: unknown, expected: unknown, message?: string): void;
|
|
478
|
+
|
|
479
|
+
/**
|
|
480
|
+
* Asserts that `actual` is not equal to `expected`. Alias of `notStrictEqual`.
|
|
481
|
+
* @param actual - The actual value
|
|
482
|
+
* @param expected - The expected value
|
|
483
|
+
* @param message - Optional message to display if the assertion fails
|
|
484
|
+
*/
|
|
485
|
+
isUnequal(actual: unknown, expected: unknown, message?: string): void;
|
|
486
|
+
|
|
487
|
+
/**
|
|
488
|
+
* Asserts that `actual` is not equal to `expected`. Alias of `notStrictEqual`.
|
|
489
|
+
* @param actual - The actual value
|
|
490
|
+
* @param expected - The expected value
|
|
491
|
+
* @param message - Optional message to display if the assertion fails
|
|
492
|
+
*/
|
|
493
|
+
notStrictEquals(actual: unknown, expected: unknown, message?: string): void;
|
|
494
|
+
|
|
495
|
+
/**
|
|
496
|
+
* Asserts that `actual` is not equal to `expected`. Alias of `notStrictEqual`.
|
|
497
|
+
* @param actual - The actual value
|
|
498
|
+
* @param expected - The expected value
|
|
499
|
+
* @param message - Optional message to display if the assertion fails
|
|
500
|
+
*/
|
|
501
|
+
isNot(actual: unknown, expected: unknown, message?: string): void;
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Asserts that `actual` is loosely equal to `expected`. Alias of `looseEqual`.
|
|
505
|
+
* @param actual - The actual value
|
|
506
|
+
* @param expected - The expected value
|
|
507
|
+
* @param message - Optional message to display if the assertion fails
|
|
508
|
+
*/
|
|
509
|
+
looseEquals(actual: unknown, expected: unknown, message?: string): void;
|
|
510
|
+
|
|
511
|
+
/**
|
|
512
|
+
* Asserts that `actual` is not loosely equal to `expected`. Alias of `notLooseEqual`.
|
|
513
|
+
* @param actual - The actual value
|
|
514
|
+
* @param expected - The expected value
|
|
515
|
+
* @param message - Optional message to display if the assertion fails
|
|
516
|
+
*/
|
|
517
|
+
notLooseEquals(actual: unknown, expected: unknown, message?: string): void;
|
|
518
|
+
|
|
519
|
+
/**
|
|
520
|
+
* Asserts that `actual` is deeply equal to `expected`. Alias of `deepEqual`.
|
|
521
|
+
* @param actual - The actual value
|
|
522
|
+
* @param expected - The expected value
|
|
523
|
+
* @param message - Optional message to display if the assertion fails
|
|
524
|
+
*/
|
|
525
|
+
same(actual: unknown, expected: unknown, message?: string): void;
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Asserts that `actual` is deeply equal to `expected`. Alias of `deepEqual`.
|
|
529
|
+
* @param actual - The actual value
|
|
530
|
+
* @param expected - The expected value
|
|
531
|
+
* @param message - Optional message to display if the assertion fails
|
|
532
|
+
*/
|
|
533
|
+
deepEquals(actual: unknown, expected: unknown, message?: string): void;
|
|
534
|
+
|
|
535
|
+
/**
|
|
536
|
+
* Asserts that `actual` is deeply equal to `expected`. Alias of `deepEqual`.
|
|
537
|
+
* @param actual - The actual value
|
|
538
|
+
* @param expected - The expected value
|
|
539
|
+
* @param message - Optional message to display if the assertion fails
|
|
540
|
+
*/
|
|
541
|
+
isEquivalent(actual: unknown, expected: unknown, message?: string): void;
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* Asserts that `actual` is not deeply equal to `expected`. Alias of `notDeepEqual`.
|
|
545
|
+
* @param actual - The actual value
|
|
546
|
+
* @param expected - The expected value
|
|
547
|
+
* @param message - Optional message to display if the assertion fails
|
|
548
|
+
*/
|
|
549
|
+
notSame(actual: unknown, expected: unknown, message?: string): void;
|
|
550
|
+
|
|
551
|
+
/**
|
|
552
|
+
* Asserts that `actual` is not deeply equal to `expected`. Alias of `notDeepEqual`.
|
|
553
|
+
* @param actual - The actual value
|
|
554
|
+
* @param expected - The expected value
|
|
555
|
+
* @param message - Optional message to display if the assertion fails
|
|
556
|
+
*/
|
|
557
|
+
notDeepEquals(actual: unknown, expected: unknown, message?: string): void;
|
|
558
|
+
|
|
559
|
+
/**
|
|
560
|
+
* Asserts that `actual` is not deeply equal to `expected`. Alias of `notDeepEqual`.
|
|
561
|
+
* @param actual - The actual value
|
|
562
|
+
* @param expected - The expected value
|
|
563
|
+
* @param message - Optional message to display if the assertion fails
|
|
564
|
+
*/
|
|
565
|
+
notEquivalent(actual: unknown, expected: unknown, message?: string): void;
|
|
566
|
+
|
|
567
|
+
/**
|
|
568
|
+
* Asserts that `actual` is not deeply equal to `expected`. Alias of `notDeepEqual`.
|
|
569
|
+
* @param actual - The actual value
|
|
570
|
+
* @param expected - The expected value
|
|
571
|
+
* @param message - Optional message to display if the assertion fails
|
|
572
|
+
*/
|
|
573
|
+
notDeeply(actual: unknown, expected: unknown, message?: string): void;
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Asserts that `actual` is not deeply equal to `expected`. Alias of `notDeepEqual`.
|
|
577
|
+
* @param actual - The actual value
|
|
578
|
+
* @param expected - The expected value
|
|
579
|
+
* @param message - Optional message to display if the assertion fails
|
|
580
|
+
*/
|
|
581
|
+
isNotDeepEqual(actual: unknown, expected: unknown, message?: string): void;
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* Asserts that `actual` is not deeply equal to `expected`. Alias of `notDeepEqual`.
|
|
585
|
+
* @param actual - The actual value
|
|
586
|
+
* @param expected - The expected value
|
|
587
|
+
* @param message - Optional message to display if the assertion fails
|
|
588
|
+
*/
|
|
589
|
+
isNotEquivalent(actual: unknown, expected: unknown, message?: string): void;
|
|
590
|
+
|
|
591
|
+
/**
|
|
592
|
+
* Asserts that `promise` is rejected. Alias of `rejects`.
|
|
593
|
+
* @param promise - The promise to test
|
|
594
|
+
* @param message - Optional message to display if the assertion fails
|
|
595
|
+
*/
|
|
596
|
+
doesNotResolve(promise: Promise<unknown>, message?: string): Promise<void>;
|
|
597
|
+
|
|
598
|
+
/**
|
|
599
|
+
* Asserts that `promise` is resolved. Alias of `resolves`.
|
|
600
|
+
* @param promise - The promise to test
|
|
601
|
+
* @param message - Optional message to display if the assertion fails
|
|
602
|
+
*/
|
|
603
|
+
doesNotReject(promise: Promise<unknown>, message?: string): Promise<void>;
|
|
604
|
+
}
|
|
605
|
+
|
|
606
|
+
export declare interface Test {
|
|
607
|
+
/**
|
|
608
|
+
* Creates a new test with the given name and function.
|
|
609
|
+
* @param name - The name of the test
|
|
610
|
+
* @param fn - The test function
|
|
611
|
+
*/
|
|
612
|
+
(name: string, fn: (t: Test) => void | Promise<void>): void;
|
|
613
|
+
/**
|
|
614
|
+
* Creates a new test with the given function.
|
|
615
|
+
* @param fn - The test function
|
|
616
|
+
*/
|
|
617
|
+
(fn: (t: Test) => void | Promise<void>): void;
|
|
618
|
+
/**
|
|
619
|
+
* Creates a new test with the given options.
|
|
620
|
+
* @param options - The test options
|
|
621
|
+
*/
|
|
622
|
+
(options: TestOptions): void;
|
|
623
|
+
/**
|
|
624
|
+
* Creates a new test with the given options and function.
|
|
625
|
+
* @param options - The test options
|
|
626
|
+
* @param fn - The test function
|
|
627
|
+
*/
|
|
628
|
+
(options: TestOptions, fn: (t: Test) => void | Promise<void>): void;
|
|
629
|
+
|
|
630
|
+
/**
|
|
631
|
+
* Creates a new test that will be skipped.
|
|
632
|
+
* @param name - The name of the test
|
|
633
|
+
* @param fn - The test function
|
|
634
|
+
*/
|
|
635
|
+
skip(name: string, fn: (t: Test) => void | Promise<void>): void;
|
|
636
|
+
/**
|
|
637
|
+
* Creates a new test that will be skipped.
|
|
638
|
+
* @param fn - The test function
|
|
639
|
+
*/
|
|
640
|
+
skip(fn: (t: Test) => void | Promise<void>): void;
|
|
641
|
+
/**
|
|
642
|
+
* Creates a new test that will be skipped.
|
|
643
|
+
* @param options - The test options
|
|
644
|
+
*/
|
|
645
|
+
skip(options: TestOptions): void;
|
|
646
|
+
/**
|
|
647
|
+
* Creates a new test that will be skipped.
|
|
648
|
+
* @param options - The test options
|
|
649
|
+
* @param fn - The test function
|
|
650
|
+
*/
|
|
651
|
+
skip(options: TestOptions, fn: (t: Test) => void | Promise<void>): void;
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* Creates a new test that will be TODO.
|
|
655
|
+
* @param name - The name of the test
|
|
656
|
+
* @param fn - The test function
|
|
657
|
+
*/
|
|
658
|
+
todo(name: string, fn: (t: Test) => void | Promise<void>): void;
|
|
659
|
+
/**
|
|
660
|
+
* Creates a new test that will be TODO.
|
|
661
|
+
* @param fn - The test function
|
|
662
|
+
*/
|
|
663
|
+
todo(fn: (t: Test) => void | Promise<void>): void;
|
|
664
|
+
/**
|
|
665
|
+
* Creates a new test that will be TODO.
|
|
666
|
+
* @param options - The test options
|
|
667
|
+
*/
|
|
668
|
+
todo(options: TestOptions): void;
|
|
669
|
+
/**
|
|
670
|
+
* Creates a new test that will be TODO.
|
|
671
|
+
* @param options - The test options
|
|
672
|
+
* @param fn - The test function
|
|
673
|
+
*/
|
|
674
|
+
todo(options: TestOptions, fn: (t: Test) => void | Promise<void>): void;
|
|
675
|
+
|
|
676
|
+
/**
|
|
677
|
+
* Creates a new test that will be run as a promise.
|
|
678
|
+
* Usually used for asynchronous tests that are based on callbacks.
|
|
679
|
+
* @param name - The name of the test
|
|
680
|
+
* @param fn - The test function
|
|
681
|
+
*/
|
|
682
|
+
asPromise(
|
|
683
|
+
name: string,
|
|
684
|
+
fn: (t: Test, resolve: () => void, reject: (error: unknown) => void) => void
|
|
685
|
+
): Promise<void>;
|
|
686
|
+
/**
|
|
687
|
+
* Creates a new test that will be run as a promise.
|
|
688
|
+
* Usually used for asynchronous tests that are based on callbacks.
|
|
689
|
+
* @param fn - The test function
|
|
690
|
+
*/
|
|
691
|
+
asPromise(
|
|
692
|
+
fn: (t: Test, resolve: () => void, reject: (error: unknown) => void) => void
|
|
693
|
+
): Promise<void>;
|
|
694
|
+
/**
|
|
695
|
+
* Creates a new test that will be run as a promise.
|
|
696
|
+
* Usually used for asynchronous tests that are based on callbacks.
|
|
697
|
+
* @param options - The test options
|
|
698
|
+
*/
|
|
699
|
+
asPromise(options: TestOptions): Promise<void>;
|
|
700
|
+
/**
|
|
701
|
+
* Creates a new test that will be run as a promise.
|
|
702
|
+
* Usually used for asynchronous tests that are based on callbacks.
|
|
703
|
+
* @param options - The test options
|
|
704
|
+
* @param fn - The test function
|
|
705
|
+
*/
|
|
706
|
+
asPromise(
|
|
707
|
+
options: TestOptions,
|
|
708
|
+
fn: (t: Test, resolve: () => void, reject: (error: unknown) => void) => void
|
|
709
|
+
): Promise<void>;
|
|
710
|
+
}
|
|
711
|
+
|
|
712
|
+
declare const test: Test;
|
|
713
|
+
|
|
714
|
+
export default test;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tape-six",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.1",
|
|
4
4
|
"description": "TAP the test harness for the modern JavaScript (ES6).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
},
|
|
55
55
|
"homepage": "https://github.com/uhop/tape-six#readme",
|
|
56
56
|
"files": [
|
|
57
|
-
"index
|
|
57
|
+
"index.*",
|
|
58
58
|
"bin",
|
|
59
59
|
"web-app",
|
|
60
60
|
"src"
|