1 | import deepEqual = require("deep-eql");
|
2 |
|
3 | declare global {
|
4 | namespace Chai {
|
5 | type Message = string | (() => string);
|
6 | type ObjectProperty = string | symbol | number;
|
7 |
|
8 | interface PathInfo {
|
9 | parent: object;
|
10 | name: string;
|
11 | value?: any;
|
12 | exists: boolean;
|
13 | }
|
14 |
|
15 | interface Constructor<T> {
|
16 | new(...args: any[]): T;
|
17 | }
|
18 |
|
19 | interface ErrorConstructor {
|
20 | new(...args: any[]): Error;
|
21 | }
|
22 |
|
23 | interface ChaiUtils {
|
24 | addChainableMethod(
|
25 |
|
26 | ctx: object,
|
27 |
|
28 | name: string,
|
29 |
|
30 | method: (...args: any[]) => void,
|
31 |
|
32 | chainingBehavior?: () => void,
|
33 | ): void;
|
34 | overwriteChainableMethod(
|
35 | ctx: object,
|
36 | name: string,
|
37 | method: (...args: any[]) => void,
|
38 | chainingBehavior?: () => void,
|
39 | ): void;
|
40 | addLengthGuard(
|
41 | fn: Function,
|
42 | assertionName: string,
|
43 | isChainable: boolean,
|
44 | ): void;
|
45 | addMethod(ctx: object, name: string, method: Function): void;
|
46 | addProperty(ctx: object, name: string, getter: () => any): void;
|
47 | overwriteMethod(ctx: object, name: string, method: Function): void;
|
48 | overwriteProperty(ctx: object, name: string, getter: (this: AssertionStatic, _super: any) => any): void;
|
49 | compareByInspect(a: object, b: object): -1 | 1;
|
50 | expectTypes(obj: object, types: string[]): void;
|
51 | flag(obj: object, key: string, value?: any): any;
|
52 | getActual(obj: object, args: AssertionArgs): any;
|
53 | getProperties(obj: object): string[];
|
54 | getEnumerableProperties(obj: object): string[];
|
55 | getOwnEnumerablePropertySymbols(obj: object): symbol[];
|
56 | getOwnEnumerableProperties(obj: object): Array<string | symbol>;
|
57 | getMessage(errorLike: Error | string): string;
|
58 | getMessage(obj: any, args: AssertionArgs): string;
|
59 | inspect(obj: any, showHidden?: boolean, depth?: number, colors?: boolean): string;
|
60 | isProxyEnabled(): boolean;
|
61 | objDisplay(obj: object): void;
|
62 | proxify(obj: object, nonChainableMethodName: string): object;
|
63 | test(obj: object, args: AssertionArgs): boolean;
|
64 | transferFlags(assertion: Assertion, obj: object, includeAll?: boolean): void;
|
65 | compatibleInstance(thrown: Error, errorLike: Error | ErrorConstructor): boolean;
|
66 | compatibleConstructor(thrown: Error, errorLike: Error | ErrorConstructor): boolean;
|
67 | compatibleMessage(thrown: Error, errMatcher: string | RegExp): boolean;
|
68 | getConstructorName(constructorFn: Function): string;
|
69 | getFuncName(constructorFn: Function): string | null;
|
70 |
|
71 | // Reexports from pathval:
|
72 | hasProperty(obj: object | undefined | null, name: ObjectProperty): boolean;
|
73 | getPathInfo(obj: object, path: string): PathInfo;
|
74 | getPathValue(obj: object, path: string): object | undefined;
|
75 |
|
76 | eql: typeof deepEqual;
|
77 | }
|
78 |
|
79 | type ChaiPlugin = (chai: ChaiStatic, utils: ChaiUtils) => void;
|
80 |
|
81 | interface ChaiStatic {
|
82 | expect: ExpectStatic;
|
83 | should(): Should;
|
84 | |
85 |
|
86 |
|
87 | use(fn: ChaiPlugin): ChaiStatic;
|
88 | util: ChaiUtils;
|
89 | assert: AssertStatic;
|
90 | config: Config;
|
91 | Assertion: AssertionStatic;
|
92 | AssertionError: typeof AssertionError;
|
93 | version: string;
|
94 | }
|
95 |
|
96 | export interface ExpectStatic {
|
97 | (val: any, message?: string): Assertion;
|
98 | fail(message?: string): never;
|
99 | fail(actual: any, expected: any, message?: string, operator?: Operator): never;
|
100 | }
|
101 |
|
102 | export interface AssertStatic extends Assert {
|
103 | }
|
104 |
|
105 |
|
106 | type AssertionArgs = [
|
107 | any,
|
108 | Message,
|
109 | Message,
|
110 | any?,
|
111 | any?,
|
112 | boolean?,
|
113 | ];
|
114 |
|
115 | export interface AssertionPrototype {
|
116 | assert(...args: AssertionArgs): void;
|
117 | _obj: any;
|
118 | }
|
119 |
|
120 | export interface AssertionStatic extends AssertionPrototype {
|
121 | prototype: AssertionPrototype;
|
122 |
|
123 | new(target: any, message?: string, ssfi?: Function, lockSsfi?: boolean): Assertion;
|
124 |
|
125 |
|
126 | includeStack: boolean;
|
127 | showDiff: boolean;
|
128 |
|
129 |
|
130 | addProperty(name: string, getter: (this: AssertionStatic) => any): void;
|
131 | addMethod(name: string, method: (this: AssertionStatic, ...args: any[]) => any): void;
|
132 | addChainableMethod(
|
133 | name: string,
|
134 | method: (this: AssertionStatic, ...args: any[]) => void,
|
135 | chainingBehavior?: () => void,
|
136 | ): void;
|
137 | overwriteProperty(name: string, getter: (this: AssertionStatic, _super: any) => any): void;
|
138 | overwriteMethod(name: string, method: (this: AssertionStatic, ...args: any[]) => any): void;
|
139 | overwriteChainableMethod(
|
140 | name: string,
|
141 | method: (this: AssertionStatic, ...args: any[]) => void,
|
142 | chainingBehavior?: () => void,
|
143 | ): void;
|
144 | }
|
145 |
|
146 | export type Operator = string;
|
147 |
|
148 | export type OperatorComparable = boolean | null | number | string | undefined | Date;
|
149 |
|
150 | interface ShouldAssertion {
|
151 | equal(value1: any, value2: any, message?: string): void;
|
152 | Throw: ShouldThrow;
|
153 | throw: ShouldThrow;
|
154 | exist(value: any, message?: string): void;
|
155 | }
|
156 |
|
157 | interface Should extends ShouldAssertion {
|
158 | not: ShouldAssertion;
|
159 | fail(message?: string): never;
|
160 | fail(actual: any, expected: any, message?: string, operator?: Operator): never;
|
161 | }
|
162 |
|
163 | interface ShouldThrow {
|
164 | (actual: Function, expected?: string | RegExp, message?: string): void;
|
165 | (actual: Function, constructor: Error | Function, expected?: string | RegExp, message?: string): void;
|
166 | }
|
167 |
|
168 | interface Assertion extends LanguageChains, NumericComparison, TypeComparison {
|
169 | not: Assertion;
|
170 | deep: Deep;
|
171 | ordered: Ordered;
|
172 | nested: Nested;
|
173 | own: Own;
|
174 | any: KeyFilter;
|
175 | all: KeyFilter;
|
176 | a: Assertion;
|
177 | an: Assertion;
|
178 | include: Include;
|
179 | includes: Include;
|
180 | contain: Include;
|
181 | contains: Include;
|
182 | ok: Assertion;
|
183 | true: Assertion;
|
184 | false: Assertion;
|
185 | null: Assertion;
|
186 | undefined: Assertion;
|
187 | NaN: Assertion;
|
188 | exist: Assertion;
|
189 | empty: Assertion;
|
190 | arguments: Assertion;
|
191 | Arguments: Assertion;
|
192 | finite: Assertion;
|
193 | equal: Equal;
|
194 | equals: Equal;
|
195 | eq: Equal;
|
196 | eql: Equal;
|
197 | eqls: Equal;
|
198 | property: Property;
|
199 | ownProperty: Property;
|
200 | haveOwnProperty: Property;
|
201 | ownPropertyDescriptor: OwnPropertyDescriptor;
|
202 | haveOwnPropertyDescriptor: OwnPropertyDescriptor;
|
203 | length: Length;
|
204 | lengthOf: Length;
|
205 | match: Match;
|
206 | matches: Match;
|
207 | string(string: string, message?: string): Assertion;
|
208 | keys: Keys;
|
209 | key(string: string): Assertion;
|
210 | throw: Throw;
|
211 | throws: Throw;
|
212 | Throw: Throw;
|
213 | respondTo: RespondTo;
|
214 | respondsTo: RespondTo;
|
215 | itself: Assertion;
|
216 | satisfy: Satisfy;
|
217 | satisfies: Satisfy;
|
218 | closeTo: CloseTo;
|
219 | approximately: CloseTo;
|
220 | members: Members;
|
221 | increase: PropertyChange;
|
222 | increases: PropertyChange;
|
223 | decrease: PropertyChange;
|
224 | decreases: PropertyChange;
|
225 | change: PropertyChange;
|
226 | changes: PropertyChange;
|
227 | extensible: Assertion;
|
228 | sealed: Assertion;
|
229 | frozen: Assertion;
|
230 | oneOf: OneOf;
|
231 | }
|
232 |
|
233 | interface LanguageChains {
|
234 | to: Assertion;
|
235 | be: Assertion;
|
236 | been: Assertion;
|
237 | is: Assertion;
|
238 | that: Assertion;
|
239 | which: Assertion;
|
240 | and: Assertion;
|
241 | has: Assertion;
|
242 | have: Assertion;
|
243 | with: Assertion;
|
244 | at: Assertion;
|
245 | of: Assertion;
|
246 | same: Assertion;
|
247 | but: Assertion;
|
248 | does: Assertion;
|
249 | }
|
250 |
|
251 | interface NumericComparison {
|
252 | above: NumberComparer;
|
253 | gt: NumberComparer;
|
254 | greaterThan: NumberComparer;
|
255 | least: NumberComparer;
|
256 | gte: NumberComparer;
|
257 | greaterThanOrEqual: NumberComparer;
|
258 | below: NumberComparer;
|
259 | lt: NumberComparer;
|
260 | lessThan: NumberComparer;
|
261 | most: NumberComparer;
|
262 | lte: NumberComparer;
|
263 | lessThanOrEqual: NumberComparer;
|
264 | within(start: number, finish: number, message?: string): Assertion;
|
265 | within(start: Date, finish: Date, message?: string): Assertion;
|
266 | }
|
267 |
|
268 | interface NumberComparer {
|
269 | (value: number | Date, message?: string): Assertion;
|
270 | }
|
271 |
|
272 | interface TypeComparison {
|
273 | (type: string, message?: string): Assertion;
|
274 | instanceof: InstanceOf;
|
275 | instanceOf: InstanceOf;
|
276 | }
|
277 |
|
278 | interface InstanceOf {
|
279 | (constructor: any, message?: string): Assertion;
|
280 | }
|
281 |
|
282 | interface CloseTo {
|
283 | (expected: number, delta: number, message?: string): Assertion;
|
284 | }
|
285 |
|
286 | interface Nested {
|
287 | include: Include;
|
288 | includes: Include;
|
289 | contain: Include;
|
290 | contains: Include;
|
291 | property: Property;
|
292 | members: Members;
|
293 | }
|
294 |
|
295 | interface Own {
|
296 | include: Include;
|
297 | includes: Include;
|
298 | contain: Include;
|
299 | contains: Include;
|
300 | property: Property;
|
301 | }
|
302 |
|
303 | interface Deep extends KeyFilter {
|
304 | be: Assertion;
|
305 | equal: Equal;
|
306 | equals: Equal;
|
307 | eq: Equal;
|
308 | include: Include;
|
309 | includes: Include;
|
310 | contain: Include;
|
311 | contains: Include;
|
312 | property: Property;
|
313 | ordered: Ordered;
|
314 | nested: Nested;
|
315 | oneOf: OneOf;
|
316 | own: Own;
|
317 | }
|
318 |
|
319 | interface Ordered {
|
320 | members: Members;
|
321 | }
|
322 |
|
323 | interface KeyFilter {
|
324 | keys: Keys;
|
325 | members: Members;
|
326 | }
|
327 |
|
328 | interface Equal {
|
329 | (value: any, message?: string): Assertion;
|
330 | }
|
331 |
|
332 | interface Property {
|
333 | (name: string | symbol, value: any, message?: string): Assertion;
|
334 | (name: string | symbol, message?: string): Assertion;
|
335 | }
|
336 |
|
337 | interface OwnPropertyDescriptor {
|
338 | (name: string | symbol, descriptor: PropertyDescriptor, message?: string): Assertion;
|
339 | (name: string | symbol, message?: string): Assertion;
|
340 | }
|
341 |
|
342 | interface Length extends LanguageChains, NumericComparison {
|
343 | (length: number, message?: string): Assertion;
|
344 | }
|
345 |
|
346 | interface Include {
|
347 | (value: any, message?: string): Assertion;
|
348 | keys: Keys;
|
349 | deep: Deep;
|
350 | ordered: Ordered;
|
351 | members: Members;
|
352 | any: KeyFilter;
|
353 | all: KeyFilter;
|
354 | oneOf: OneOf;
|
355 | }
|
356 |
|
357 | interface OneOf {
|
358 | (list: readonly unknown[], message?: string): Assertion;
|
359 | }
|
360 |
|
361 | interface Match {
|
362 | (regexp: RegExp, message?: string): Assertion;
|
363 | }
|
364 |
|
365 | interface Keys {
|
366 | (...keys: string[]): Assertion;
|
367 | (keys: readonly any[] | Object): Assertion;
|
368 | }
|
369 |
|
370 | interface Throw {
|
371 | (expected?: string | RegExp, message?: string): Assertion;
|
372 | (constructor: Error | Function, expected?: string | RegExp, message?: string): Assertion;
|
373 | }
|
374 |
|
375 | interface RespondTo {
|
376 | (method: string, message?: string): Assertion;
|
377 | }
|
378 |
|
379 | interface Satisfy {
|
380 | (matcher: Function, message?: string): Assertion;
|
381 | }
|
382 |
|
383 | interface Members {
|
384 | (set: readonly any[], message?: string): Assertion;
|
385 | }
|
386 |
|
387 | interface PropertyChange {
|
388 | (object: Object, property?: string, message?: string): DeltaAssertion;
|
389 | }
|
390 |
|
391 | interface DeltaAssertion extends Assertion {
|
392 | by(delta: number, msg?: string): Assertion;
|
393 | }
|
394 |
|
395 | export interface Assert {
|
396 | |
397 |
|
398 |
|
399 |
|
400 | (expression: any, message?: string): asserts expression;
|
401 |
|
402 | |
403 |
|
404 |
|
405 |
|
406 |
|
407 |
|
408 | fail(message?: string): never;
|
409 |
|
410 | |
411 |
|
412 |
|
413 |
|
414 |
|
415 |
|
416 |
|
417 |
|
418 |
|
419 |
|
420 | fail<T>(actual: T, expected: T, message?: string, operator?: Operator): never;
|
421 |
|
422 | |
423 |
|
424 |
|
425 |
|
426 |
|
427 |
|
428 | isOk(value: unknown, message?: string): asserts value;
|
429 |
|
430 | |
431 |
|
432 |
|
433 |
|
434 |
|
435 |
|
436 | ok(value: unknown, message?: string): asserts value;
|
437 |
|
438 | |
439 |
|
440 |
|
441 |
|
442 |
|
443 |
|
444 |
|
445 | isNotOk<T>(value: T, message?: string): void;
|
446 |
|
447 | |
448 |
|
449 |
|
450 |
|
451 |
|
452 |
|
453 |
|
454 | notOk<T>(value: T, message?: string): void;
|
455 |
|
456 | |
457 |
|
458 |
|
459 |
|
460 |
|
461 |
|
462 |
|
463 |
|
464 | equal<T>(actual: T, expected: T, message?: string): void;
|
465 |
|
466 | |
467 |
|
468 |
|
469 |
|
470 |
|
471 |
|
472 |
|
473 |
|
474 | notEqual<T>(actual: T, expected: T, message?: string): void;
|
475 |
|
476 | |
477 |
|
478 |
|
479 |
|
480 |
|
481 |
|
482 |
|
483 |
|
484 | strictEqual<T>(actual: T, expected: T, message?: string): void;
|
485 |
|
486 | |
487 |
|
488 |
|
489 |
|
490 |
|
491 |
|
492 |
|
493 |
|
494 | notStrictEqual<T>(actual: T, expected: T, message?: string): void;
|
495 |
|
496 | |
497 |
|
498 |
|
499 |
|
500 |
|
501 |
|
502 |
|
503 |
|
504 | deepEqual<T>(actual: T, expected: T, message?: string): void;
|
505 |
|
506 | |
507 |
|
508 |
|
509 |
|
510 |
|
511 |
|
512 |
|
513 |
|
514 | notDeepEqual<T>(actual: T, expected: T, message?: string): void;
|
515 |
|
516 | |
517 |
|
518 |
|
519 |
|
520 |
|
521 |
|
522 |
|
523 |
|
524 | deepStrictEqual<T>(actual: T, expected: T, message?: string): void;
|
525 |
|
526 | |
527 |
|
528 |
|
529 |
|
530 |
|
531 |
|
532 |
|
533 | isAbove(valueToCheck: number, valueToBeAbove: number, message?: string): void;
|
534 |
|
535 | |
536 |
|
537 |
|
538 |
|
539 |
|
540 |
|
541 |
|
542 | isAtLeast(valueToCheck: number, valueToBeAtLeast: number, message?: string): void;
|
543 |
|
544 | |
545 |
|
546 |
|
547 |
|
548 |
|
549 |
|
550 |
|
551 | isBelow(valueToCheck: number, valueToBeBelow: number, message?: string): void;
|
552 |
|
553 | |
554 |
|
555 |
|
556 |
|
557 |
|
558 |
|
559 |
|
560 | isAtMost(valueToCheck: number, valueToBeAtMost: number, message?: string): void;
|
561 |
|
562 | |
563 |
|
564 |
|
565 |
|
566 |
|
567 |
|
568 | isTrue(value: unknown, message?: string): asserts value is true;
|
569 |
|
570 | |
571 |
|
572 |
|
573 |
|
574 |
|
575 |
|
576 | isFalse(value: unknown, message?: string): asserts value is false;
|
577 |
|
578 | |
579 |
|
580 |
|
581 |
|
582 |
|
583 |
|
584 |
|
585 | isNotTrue<T>(value: T, message?: string): asserts value is Exclude<T, true>;
|
586 |
|
587 | |
588 |
|
589 |
|
590 |
|
591 |
|
592 |
|
593 | isNotFalse<T>(value: T, message?: string): asserts value is Exclude<T, false>;
|
594 |
|
595 | |
596 |
|
597 |
|
598 |
|
599 |
|
600 |
|
601 | isNull(value: unknown, message?: string): asserts value is null;
|
602 |
|
603 | |
604 |
|
605 |
|
606 |
|
607 |
|
608 |
|
609 |
|
610 | isNotNull<T>(value: T, message?: string): asserts value is Exclude<T, null>;
|
611 |
|
612 | |
613 |
|
614 |
|
615 |
|
616 |
|
617 |
|
618 |
|
619 | isNaN<T>(value: T, message?: string): void;
|
620 |
|
621 | |
622 |
|
623 |
|
624 |
|
625 |
|
626 |
|
627 |
|
628 | isNotNaN<T>(value: T, message?: string): void;
|
629 |
|
630 | |
631 |
|
632 |
|
633 |
|
634 |
|
635 |
|
636 |
|
637 | exists<T>(value: T, message?: string): asserts value is NonNullable<T>;
|
638 |
|
639 | |
640 |
|
641 |
|
642 |
|
643 |
|
644 |
|
645 | notExists(value: unknown, message?: string): asserts value is
|
646 | | null
|
647 | | undefined;
|
648 |
|
649 | |
650 |
|
651 |
|
652 |
|
653 |
|
654 |
|
655 | isUndefined(value: unknown, message?: string): asserts value is undefined;
|
656 |
|
657 | |
658 |
|
659 |
|
660 |
|
661 |
|
662 |
|
663 |
|
664 | isDefined<T>(value: T, message?: string): asserts value is Exclude<T, undefined>;
|
665 |
|
666 | |
667 |
|
668 |
|
669 |
|
670 |
|
671 |
|
672 |
|
673 | isFunction<T>(value: T, message?: string): void;
|
674 |
|
675 | |
676 |
|
677 |
|
678 |
|
679 |
|
680 |
|
681 |
|
682 | isNotFunction<T>(value: T, message?: string): void;
|
683 |
|
684 | |
685 |
|
686 |
|
687 |
|
688 |
|
689 |
|
690 |
|
691 |
|
692 |
|
693 | isObject<T>(value: T, message?: string): void;
|
694 |
|
695 | |
696 |
|
697 |
|
698 |
|
699 |
|
700 |
|
701 |
|
702 |
|
703 | isNotObject<T>(value: T, message?: string): void;
|
704 |
|
705 | |
706 |
|
707 |
|
708 |
|
709 |
|
710 |
|
711 |
|
712 | isArray<T>(value: T, message?: string): void;
|
713 |
|
714 | |
715 |
|
716 |
|
717 |
|
718 |
|
719 |
|
720 |
|
721 | isNotArray<T>(value: T, message?: string): void;
|
722 |
|
723 | |
724 |
|
725 |
|
726 |
|
727 |
|
728 |
|
729 |
|
730 | isString<T>(value: T, message?: string): void;
|
731 |
|
732 | |
733 |
|
734 |
|
735 |
|
736 |
|
737 |
|
738 |
|
739 | isNotString<T>(value: T, message?: string): void;
|
740 |
|
741 | |
742 |
|
743 |
|
744 |
|
745 |
|
746 |
|
747 |
|
748 | isNumber<T>(value: T, message?: string): void;
|
749 |
|
750 | |
751 |
|
752 |
|
753 |
|
754 |
|
755 |
|
756 |
|
757 | isNotNumber<T>(value: T, message?: string): void;
|
758 |
|
759 | |
760 |
|
761 |
|
762 |
|
763 |
|
764 |
|
765 |
|
766 |
|
767 | isFinite<T>(value: T, message?: string): void;
|
768 |
|
769 | |
770 |
|
771 |
|
772 |
|
773 |
|
774 |
|
775 |
|
776 | isBoolean<T>(value: T, message?: string): void;
|
777 |
|
778 | |
779 |
|
780 |
|
781 |
|
782 |
|
783 |
|
784 |
|
785 | isNotBoolean<T>(value: T, message?: string): void;
|
786 |
|
787 | |
788 |
|
789 |
|
790 |
|
791 |
|
792 |
|
793 |
|
794 |
|
795 | typeOf<T>(value: T, name: string, message?: string): void;
|
796 |
|
797 | |
798 |
|
799 |
|
800 |
|
801 |
|
802 |
|
803 |
|
804 |
|
805 | notTypeOf<T>(value: T, name: string, message?: string): void;
|
806 |
|
807 | |
808 |
|
809 |
|
810 |
|
811 |
|
812 |
|
813 |
|
814 |
|
815 | instanceOf<T>(
|
816 | value: unknown,
|
817 | constructor: Constructor<T>,
|
818 | message?: string,
|
819 | ): asserts value is T;
|
820 |
|
821 | /**
|
822 | * Asserts that value is not an instance of constructor.
|
823 | *
|
824 | * T Type of value.
|
825 | * U Type that value shouldn't be an instance of.
|
826 | * @param value Actual value.
|
827 | * @param constructor Potential expected contructor of value.
|
828 | * @param message Message to display on error.
|
829 | */
|
830 | notInstanceOf<T, U>(value: T, type: Constructor<U>, message?: string): asserts value is Exclude<T, U>;
|
831 |
|
832 | /**
|
833 | * Asserts that haystack includes needle.
|
834 | *
|
835 | * @param haystack Container string.
|
836 | * @param needle Potential substring of haystack.
|
837 | * @param message Message to display on error.
|
838 | */
|
839 | include(haystack: string, needle: string, message?: string): void;
|
840 |
|
841 | /**
|
842 | * Asserts that haystack includes needle.
|
843 | *
|
844 | * T Type of values in haystack.
|
845 | * @param haystack Container array, set or map.
|
846 | * @param needle Potential value contained in haystack.
|
847 | * @param message Message to display on error.
|
848 | */
|
849 | include<T>(
|
850 | haystack: readonly T[] | ReadonlySet<T> | ReadonlyMap<any, T>,
|
851 | needle: T,
|
852 | message?: string,
|
853 | ): void;
|
854 |
|
855 | /**
|
856 | * Asserts that haystack includes needle.
|
857 | *
|
858 | * T Type of values in haystack.
|
859 | * @param haystack WeakSet container.
|
860 | * @param needle Potential value contained in haystack.
|
861 | * @param message Message to display on error.
|
862 | */
|
863 | include<T extends object>(haystack: WeakSet<T>, needle: T, message?: string): void;
|
864 |
|
865 | /**
|
866 | * Asserts that haystack includes needle.
|
867 | *
|
868 | * T Type of haystack.
|
869 | * @param haystack Object.
|
870 | * @param needle Potential subset of the haystack's properties.
|
871 | * @param message Message to display on error.
|
872 | */
|
873 | include<T>(haystack: T, needle: Partial<T>, message?: string): void;
|
874 |
|
875 | /**
|
876 | * Asserts that haystack does not include needle.
|
877 | *
|
878 | * @param haystack Container string.
|
879 | * @param needle Potential substring of haystack.
|
880 | * @param message Message to display on error.
|
881 | */
|
882 | notInclude(haystack: string, needle: string, message?: string): void;
|
883 |
|
884 | /**
|
885 | * Asserts that haystack does not include needle.
|
886 | *
|
887 | * T Type of values in haystack.
|
888 | * @param haystack Container array, set or map.
|
889 | * @param needle Potential value contained in haystack.
|
890 | * @param message Message to display on error.
|
891 | */
|
892 | notInclude<T>(
|
893 | haystack: readonly T[] | ReadonlySet<T> | ReadonlyMap<any, T>,
|
894 | needle: T,
|
895 | message?: string,
|
896 | ): void;
|
897 |
|
898 | /**
|
899 | * Asserts that haystack does not include needle.
|
900 | *
|
901 | * T Type of values in haystack.
|
902 | * @param haystack WeakSet container.
|
903 | * @param needle Potential value contained in haystack.
|
904 | * @param message Message to display on error.
|
905 | */
|
906 | notInclude<T extends object>(haystack: WeakSet<T>, needle: T, message?: string): void;
|
907 |
|
908 | /**
|
909 | * Asserts that haystack does not include needle.
|
910 | *
|
911 | * T Type of haystack.
|
912 | * @param haystack Object.
|
913 | * @param needle Potential subset of the haystack's properties.
|
914 | * @param message Message to display on error.
|
915 | */
|
916 | notInclude<T>(haystack: T, needle: Partial<T>, message?: string): void;
|
917 |
|
918 | /**
|
919 | * Asserts that haystack includes needle. Deep equality is used.
|
920 | *
|
921 | * @param haystack Container string.
|
922 | * @param needle Potential substring of haystack.
|
923 | * @param message Message to display on error.
|
924 | *
|
925 | * @deprecated Does not have any effect on string. Use {@link Assert#include} instead.
|
926 | */
|
927 | deepInclude(haystack: string, needle: string, message?: string): void;
|
928 |
|
929 | /**
|
930 | * Asserts that haystack includes needle. Deep equality is used.
|
931 | *
|
932 | * T Type of values in haystack.
|
933 | * @param haystack Container array, set or map.
|
934 | * @param needle Potential value contained in haystack.
|
935 | * @param message Message to display on error.
|
936 | */
|
937 | deepInclude<T>(
|
938 | haystack: readonly T[] | ReadonlySet<T> | ReadonlyMap<any, T>,
|
939 | needle: T,
|
940 | message?: string,
|
941 | ): void;
|
942 |
|
943 | /**
|
944 | * Asserts that haystack includes needle. Deep equality is used.
|
945 | *
|
946 | * T Type of haystack.
|
947 | * @param haystack Object.
|
948 | * @param needle Potential subset of the haystack's properties.
|
949 | * @param message Message to display on error.
|
950 | */
|
951 | deepInclude<T>(haystack: T, needle: T extends WeakSet<any> ? never : Partial<T>, message?: string): void;
|
952 |
|
953 | /**
|
954 | * Asserts that haystack does not include needle. Deep equality is used.
|
955 | *
|
956 | * @param haystack Container string.
|
957 | * @param needle Potential substring of haystack.
|
958 | * @param message Message to display on error.
|
959 | *
|
960 | * @deprecated Does not have any effect on string. Use {@link Assert#notInclude} instead.
|
961 | */
|
962 | notDeepInclude(haystack: string, needle: string, message?: string): void;
|
963 |
|
964 | /**
|
965 | * Asserts that haystack does not include needle. Deep equality is used.
|
966 | *
|
967 | * T Type of values in haystack.
|
968 | * @param haystack Container array, set or map.
|
969 | * @param needle Potential value contained in haystack.
|
970 | * @param message Message to display on error.
|
971 | */
|
972 | notDeepInclude<T>(
|
973 | haystack: readonly T[] | ReadonlySet<T> | ReadonlyMap<any, T>,
|
974 | needle: T,
|
975 | message?: string,
|
976 | ): void;
|
977 |
|
978 | /**
|
979 | * Asserts that haystack does not include needle. Deep equality is used.
|
980 | *
|
981 | * T Type of haystack.
|
982 | * @param haystack Object.
|
983 | * @param needle Potential subset of the haystack's properties.
|
984 | * @param message Message to display on error.
|
985 | */
|
986 | notDeepInclude<T>(haystack: T, needle: T extends WeakSet<any> ? never : Partial<T>, message?: string): void;
|
987 |
|
988 | /**
|
989 | * Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the inclusion of a subset of properties in an object.
|
990 | *
|
991 | * Enables the use of dot- and bracket-notation for referencing nested properties.
|
992 | * ‘[]’ and ‘.’ in property names can be escaped using double backslashes.Asserts that ‘haystack’ includes ‘needle’.
|
993 | * Can be used to assert the inclusion of a subset of properties in an object.
|
994 | * Enables the use of dot- and bracket-notation for referencing nested properties.
|
995 | * ‘[]’ and ‘.’ in property names can be escaped using double backslashes.
|
996 | *
|
997 | * @param haystack
|
998 | * @param needle
|
999 | * @param message Message to display on error.
|
1000 | */
|
1001 | nestedInclude(haystack: any, needle: any, message?: string): void;
|
1002 |
|
1003 | /**
|
1004 | * Asserts that ‘haystack’ does not include ‘needle’. Can be used to assert the absence of a subset of properties in an object.
|
1005 | *
|
1006 | * Enables the use of dot- and bracket-notation for referencing nested properties.
|
1007 | * ‘[]’ and ‘.’ in property names can be escaped using double backslashes.Asserts that ‘haystack’ includes ‘needle’.
|
1008 | * Can be used to assert the inclusion of a subset of properties in an object.
|
1009 | * Enables the use of dot- and bracket-notation for referencing nested properties.
|
1010 | * ‘[]’ and ‘.’ in property names can be escaped using double backslashes.
|
1011 | *
|
1012 | * @param haystack
|
1013 | * @param needle
|
1014 | * @param message Message to display on error.
|
1015 | */
|
1016 | notNestedInclude(haystack: any, needle: any, message?: string): void;
|
1017 |
|
1018 | /**
|
1019 | * Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the inclusion of a subset of properties in an object while checking for deep equality
|
1020 | *
|
1021 | * Enables the use of dot- and bracket-notation for referencing nested properties.
|
1022 | * ‘[]’ and ‘.’ in property names can be escaped using double backslashes.Asserts that ‘haystack’ includes ‘needle’.
|
1023 | * Can be used to assert the inclusion of a subset of properties in an object.
|
1024 | * Enables the use of dot- and bracket-notation for referencing nested properties.
|
1025 | * ‘[]’ and ‘.’ in property names can be escaped using double backslashes.
|
1026 | *
|
1027 | * @param haystack
|
1028 | * @param needle
|
1029 | * @param message Message to display on error.
|
1030 | */
|
1031 | deepNestedInclude(haystack: any, needle: any, message?: string): void;
|
1032 |
|
1033 | /**
|
1034 | * Asserts that ‘haystack’ does not include ‘needle’. Can be used to assert the absence of a subset of properties in an object while checking for deep equality.
|
1035 | *
|
1036 | * Enables the use of dot- and bracket-notation for referencing nested properties.
|
1037 | * ‘[]’ and ‘.’ in property names can be escaped using double backslashes.Asserts that ‘haystack’ includes ‘needle’.
|
1038 | * Can be used to assert the inclusion of a subset of properties in an object.
|
1039 | * Enables the use of dot- and bracket-notation for referencing nested properties.
|
1040 | * ‘[]’ and ‘.’ in property names can be escaped using double backslashes.
|
1041 | *
|
1042 | * @param haystack
|
1043 | * @param needle
|
1044 | * @param message Message to display on error.
|
1045 | */
|
1046 | notDeepNestedInclude(haystack: any, needle: any, message?: string): void;
|
1047 |
|
1048 | /**
|
1049 | * Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the inclusion of a subset of properties in an object while ignoring inherited properties.
|
1050 | *
|
1051 | * @param haystack
|
1052 | * @param needle
|
1053 | * @param message Message to display on error.
|
1054 | */
|
1055 | ownInclude(haystack: any, needle: any, message?: string): void;
|
1056 |
|
1057 | /**
|
1058 | * Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the absence of a subset of properties in an object while ignoring inherited properties.
|
1059 | *
|
1060 | * @param haystack
|
1061 | * @param needle
|
1062 | * @param message Message to display on error.
|
1063 | */
|
1064 | notOwnInclude(haystack: any, needle: any, message?: string): void;
|
1065 |
|
1066 | /**
|
1067 | * Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the inclusion of a subset of properties in an object while ignoring inherited properties and checking for deep
|
1068 | *
|
1069 | * @param haystack
|
1070 | * @param needle
|
1071 | * @param message Message to display on error.
|
1072 | */
|
1073 | deepOwnInclude(haystack: any, needle: any, message?: string): void;
|
1074 |
|
1075 | /**
|
1076 | * Asserts that ‘haystack’ includes ‘needle’. Can be used to assert the absence of a subset of properties in an object while ignoring inherited properties and checking for deep equality.
|
1077 | *
|
1078 | * @param haystack
|
1079 | * @param needle
|
1080 | * @param message Message to display on error.
|
1081 | */
|
1082 | notDeepOwnInclude(haystack: any, needle: any, message?: string): void;
|
1083 |
|
1084 | /**
|
1085 | * Asserts that value matches the regular expression regexp.
|
1086 | *
|
1087 | * @param value Actual value.
|
1088 | * @param regexp Potential match of value.
|
1089 | * @param message Message to display on error.
|
1090 | */
|
1091 | match(value: string, regexp: RegExp, message?: string): void;
|
1092 |
|
1093 | /**
|
1094 | * Asserts that value does not match the regular expression regexp.
|
1095 | *
|
1096 | * @param value Actual value.
|
1097 | * @param regexp Potential match of value.
|
1098 | * @param message Message to display on error.
|
1099 | */
|
1100 | notMatch(expected: any, regexp: RegExp, message?: string): void;
|
1101 |
|
1102 | /**
|
1103 | * Asserts that object has a property named by property.
|
1104 | *
|
1105 | * T Type of object.
|
1106 | * @param object Container object.
|
1107 | * @param property Potential contained property of object.
|
1108 | * @param message Message to display on error.
|
1109 | */
|
1110 | property<T>(object: T, property: string, message?: string): void;
|
1111 |
|
1112 | /**
|
1113 | * Asserts that object does not have a property named by property.
|
1114 | *
|
1115 | * T Type of object.
|
1116 | * @param object Container object.
|
1117 | * @param property Potential contained property of object.
|
1118 | * @param message Message to display on error.
|
1119 | */
|
1120 | notProperty<T>(object: T, property: string, message?: string): void;
|
1121 |
|
1122 | /**
|
1123 | * Asserts that object has a property named by property, which can be a string
|
1124 | * using dot- and bracket-notation for deep reference.
|
1125 | *
|
1126 | * T Type of object.
|
1127 | * @param object Container object.
|
1128 | * @param property Potential contained property of object.
|
1129 | * @param message Message to display on error.
|
1130 | */
|
1131 | deepProperty<T>(object: T, property: string, message?: string): void;
|
1132 |
|
1133 | /**
|
1134 | * Asserts that object does not have a property named by property, which can be a
|
1135 | * string using dot- and bracket-notation for deep reference.
|
1136 | *
|
1137 | * T Type of object.
|
1138 | * @param object Container object.
|
1139 | * @param property Potential contained property of object.
|
1140 | * @param message Message to display on error.
|
1141 | */
|
1142 | notDeepProperty<T>(object: T, property: string, message?: string): void;
|
1143 |
|
1144 | /**
|
1145 | * Asserts that object has a property named by property with value given by value.
|
1146 | *
|
1147 | * T Type of object.
|
1148 | * V Type of value.
|
1149 | * @param object Container object.
|
1150 | * @param property Potential contained property of object.
|
1151 | * @param value Potential expected property value.
|
1152 | * @param message Message to display on error.
|
1153 | */
|
1154 | propertyVal<T, V>(object: T, property: string, value: V, message?: string): void;
|
1155 |
|
1156 | /**
|
1157 | * Asserts that object has a property named by property with value given by value.
|
1158 | *
|
1159 | * T Type of object.
|
1160 | * V Type of value.
|
1161 | * @param object Container object.
|
1162 | * @param property Potential contained property of object.
|
1163 | * @param value Potential expected property value.
|
1164 | * @param message Message to display on error.
|
1165 | */
|
1166 | notPropertyVal<T, V>(object: T, property: string, value: V, message?: string): void;
|
1167 |
|
1168 | /**
|
1169 | * Asserts that object has a property named by property, which can be a string
|
1170 | * using dot- and bracket-notation for deep reference.
|
1171 | *
|
1172 | * T Type of object.
|
1173 | * V Type of value.
|
1174 | * @param object Container object.
|
1175 | * @param property Potential contained property of object.
|
1176 | * @param value Potential expected property value.
|
1177 | * @param message Message to display on error.
|
1178 | */
|
1179 | deepPropertyVal<T, V>(object: T, property: string, value: V, message?: string): void;
|
1180 |
|
1181 | /**
|
1182 | * Asserts that object does not have a property named by property, which can be a
|
1183 | * string using dot- and bracket-notation for deep reference.
|
1184 | *
|
1185 | * T Type of object.
|
1186 | * V Type of value.
|
1187 | * @param object Container object.
|
1188 | * @param property Potential contained property of object.
|
1189 | * @param value Potential expected property value.
|
1190 | * @param message Message to display on error.
|
1191 | */
|
1192 | notDeepPropertyVal<T, V>(object: T, property: string, value: V, message?: string): void;
|
1193 |
|
1194 | /**
|
1195 | * Asserts that object has a length property with the expected value.
|
1196 | *
|
1197 | * T Type of object.
|
1198 | * @param object Container object.
|
1199 | * @param length Potential expected length of object.
|
1200 | * @param message Message to display on error.
|
1201 | */
|
1202 | lengthOf<T extends { readonly length?: number | undefined } | { readonly size?: number | undefined }>(
|
1203 | object: T,
|
1204 | length: number,
|
1205 | message?: string,
|
1206 | ): void;
|
1207 |
|
1208 | |
1209 |
|
1210 |
|
1211 |
|
1212 |
|
1213 |
|
1214 |
|
1215 |
|
1216 | throw(fn: () => void, errMsgMatcher?: RegExp | string, ignored?: any, message?: string): void;
|
1217 |
|
1218 | /**
|
1219 | * Asserts that fn will throw an error.
|
1220 | *
|
1221 | * @param fn Function that may throw.
|
1222 | * @param errorLike Expected error constructor or error instance.
|
1223 | * @param errMsgMatcher Expected error message matcher.
|
1224 | * @param message Message to display on error.
|
1225 | */
|
1226 | throw(
|
1227 | fn: () => void,
|
1228 | errorLike?: ErrorConstructor | Error | null,
|
1229 | errMsgMatcher?: RegExp | string | null,
|
1230 | message?: string,
|
1231 | ): void;
|
1232 |
|
1233 | /**
|
1234 | * Asserts that fn will throw an error.
|
1235 | *
|
1236 | * @param fn Function that may throw.
|
1237 | * @param errMsgMatcher Expected error message matcher.
|
1238 | * @param ignored Ignored parameter.
|
1239 | * @param message Message to display on error.
|
1240 | */
|
1241 | throws(fn: () => void, errMsgMatcher?: RegExp | string, ignored?: any, message?: string): void;
|
1242 |
|
1243 | /**
|
1244 | * Asserts that fn will throw an error.
|
1245 | *
|
1246 | * @param fn Function that may throw.
|
1247 | * @param errorLike Expected error constructor or error instance.
|
1248 | * @param errMsgMatcher Expected error message matcher.
|
1249 | * @param message Message to display on error.
|
1250 | */
|
1251 | throws(
|
1252 | fn: () => void,
|
1253 | errorLike?: ErrorConstructor | Error | null,
|
1254 | errMsgMatcher?: RegExp | string | null,
|
1255 | message?: string,
|
1256 | ): void;
|
1257 |
|
1258 | /**
|
1259 | * Asserts that fn will throw an error.
|
1260 | *
|
1261 | * @param fn Function that may throw.
|
1262 | * @param errMsgMatcher Expected error message matcher.
|
1263 | * @param ignored Ignored parameter.
|
1264 | * @param message Message to display on error.
|
1265 | */
|
1266 | Throw(fn: () => void, errMsgMatcher?: RegExp | string, ignored?: any, message?: string): void;
|
1267 |
|
1268 | /**
|
1269 | * Asserts that fn will throw an error.
|
1270 | *
|
1271 | * @param fn Function that may throw.
|
1272 | * @param errorLike Expected error constructor or error instance.
|
1273 | * @param errMsgMatcher Expected error message matcher.
|
1274 | * @param message Message to display on error.
|
1275 | */
|
1276 | Throw(
|
1277 | fn: () => void,
|
1278 | errorLike?: ErrorConstructor | Error | null,
|
1279 | errMsgMatcher?: RegExp | string | null,
|
1280 | message?: string,
|
1281 | ): void;
|
1282 |
|
1283 | /**
|
1284 | * Asserts that fn will not throw an error.
|
1285 | *
|
1286 | * @param fn Function that may throw.
|
1287 | * @param errMsgMatcher Expected error message matcher.
|
1288 | * @param ignored Ignored parameter.
|
1289 | * @param message Message to display on error.
|
1290 | */
|
1291 | doesNotThrow(fn: () => void, errMsgMatcher?: RegExp | string, ignored?: any, message?: string): void;
|
1292 |
|
1293 | /**
|
1294 | * Asserts that fn will not throw an error.
|
1295 | *
|
1296 | * @param fn Function that may throw.
|
1297 | * @param errorLike Expected error constructor or error instance.
|
1298 | * @param errMsgMatcher Expected error message matcher.
|
1299 | * @param message Message to display on error.
|
1300 | */
|
1301 | doesNotThrow(
|
1302 | fn: () => void,
|
1303 | errorLike?: ErrorConstructor | Error | null,
|
1304 | errMsgMatcher?: RegExp | string | null,
|
1305 | message?: string,
|
1306 | ): void;
|
1307 |
|
1308 | /**
|
1309 | * Compares two values using operator.
|
1310 | *
|
1311 | * @param val1 Left value during comparison.
|
1312 | * @param operator Comparison operator.
|
1313 | * @param val2 Right value during comparison.
|
1314 | * @param message Message to display on error.
|
1315 | */
|
1316 | operator(val1: OperatorComparable, operator: Operator, val2: OperatorComparable, message?: string): void;
|
1317 |
|
1318 | /**
|
1319 | * Asserts that the target is equal to expected, to within a +/- delta range.
|
1320 | *
|
1321 | * @param actual Actual value
|
1322 | * @param expected Potential expected value.
|
1323 | * @param delta Maximum differenced between values.
|
1324 | * @param message Message to display on error.
|
1325 | */
|
1326 | closeTo(actual: number, expected: number, delta: number, message?: string): void;
|
1327 |
|
1328 | /**
|
1329 | * Asserts that the target is equal to expected, to within a +/- delta range.
|
1330 | *
|
1331 | * @param actual Actual value
|
1332 | * @param expected Potential expected value.
|
1333 | * @param delta Maximum differenced between values.
|
1334 | * @param message Message to display on error.
|
1335 | */
|
1336 | approximately(act: number, exp: number, delta: number, message?: string): void;
|
1337 |
|
1338 | /**
|
1339 | * Asserts that set1 and set2 have the same members. Order is not take into account.
|
1340 | *
|
1341 | * T Type of set values.
|
1342 | * @param set1 Actual set of values.
|
1343 | * @param set2 Potential expected set of values.
|
1344 | * @param message Message to display on error.
|
1345 | */
|
1346 | sameMembers<T>(set1: T[], set2: T[], message?: string): void;
|
1347 |
|
1348 | /**
|
1349 | * Asserts that set1 and set2 have the same members using deep equality checking.
|
1350 | * Order is not take into account.
|
1351 | *
|
1352 | * T Type of set values.
|
1353 | * @param set1 Actual set of values.
|
1354 | * @param set2 Potential expected set of values.
|
1355 | * @param message Message to display on error.
|
1356 | */
|
1357 | sameDeepMembers<T>(set1: T[], set2: T[], message?: string): void;
|
1358 |
|
1359 | /**
|
1360 | * Asserts that `set1` and `set2` don't have the same members in any order.
|
1361 | * Uses a deep equality check.
|
1362 | *
|
1363 | * T Type of set values.
|
1364 | * @param set1
|
1365 | * @param set2
|
1366 | * @param message
|
1367 | */
|
1368 | notSameDeepMembers<T>(set1: T[], set2: T[], message?: string): void;
|
1369 |
|
1370 | /**
|
1371 | * Asserts that set1 and set2 have the same members in the same order.
|
1372 | * Uses a strict equality check (===).
|
1373 | *
|
1374 | * T Type of set values.
|
1375 | * @param set1 Actual set of values.
|
1376 | * @param set2 Potential expected set of values.
|
1377 | * @param message Message to display on error.
|
1378 | */
|
1379 | sameOrderedMembers<T>(set1: T[], set2: T[], message?: string): void;
|
1380 |
|
1381 | /**
|
1382 | * Asserts that set1 and set2 don’t have the same members in the same order.
|
1383 | * Uses a strict equality check (===).
|
1384 | *
|
1385 | * T Type of set values.
|
1386 | * @param set1 Actual set of values.
|
1387 | * @param set2 Potential expected set of values.
|
1388 | * @param message Message to display on error.
|
1389 | */
|
1390 | notSameOrderedMembers<T>(set1: T[], set2: T[], message?: string): void;
|
1391 |
|
1392 | /**
|
1393 | * Asserts that set1 and set2 have the same members in the same order.
|
1394 | * Uses a deep equality check.
|
1395 | *
|
1396 | * T Type of set values.
|
1397 | * @param set1 Actual set of values.
|
1398 | * @param set2 Potential expected set of values.
|
1399 | * @param message Message to display on error.
|
1400 | */
|
1401 | sameDeepOrderedMembers<T>(set1: T[], set2: T[], message?: string): void;
|
1402 |
|
1403 | /**
|
1404 | * Asserts that set1 and set2 don’t have the same members in the same order.
|
1405 | * Uses a deep equality check.
|
1406 | *
|
1407 | * T Type of set values.
|
1408 | * @param set1 Actual set of values.
|
1409 | * @param set2 Potential expected set of values.
|
1410 | * @param message Message to display on error.
|
1411 | */
|
1412 | notSameDeepOrderedMembers<T>(set1: T[], set2: T[], message?: string): void;
|
1413 |
|
1414 | /**
|
1415 | * Asserts that subset is included in superset in the same order beginning with the first element in superset.
|
1416 | * Uses a strict equality check (===).
|
1417 | *
|
1418 | * T Type of set values.
|
1419 | * @param superset Actual set of values.
|
1420 | * @param subset Potential contained set of values.
|
1421 | * @param message Message to display on error.
|
1422 | */
|
1423 | includeOrderedMembers<T>(superset: T[], subset: T[], message?: string): void;
|
1424 |
|
1425 | /**
|
1426 | * Asserts that subset isn’t included in superset in the same order beginning with the first element in superset.
|
1427 | * Uses a strict equality check (===).
|
1428 | *
|
1429 | * T Type of set values.
|
1430 | * @param superset Actual set of values.
|
1431 | * @param subset Potential contained set of values.
|
1432 | * @param message Message to display on error.
|
1433 | */
|
1434 | notIncludeOrderedMembers<T>(superset: T[], subset: T[], message?: string): void;
|
1435 |
|
1436 | /**
|
1437 | * Asserts that subset is included in superset in the same order beginning with the first element in superset.
|
1438 | * Uses a deep equality check.
|
1439 | *
|
1440 | * T Type of set values.
|
1441 | * @param superset Actual set of values.
|
1442 | * @param subset Potential contained set of values.
|
1443 | * @param message Message to display on error.
|
1444 | */
|
1445 | includeDeepOrderedMembers<T>(superset: T[], subset: T[], message?: string): void;
|
1446 |
|
1447 | /**
|
1448 | * Asserts that subset isn’t included in superset in the same order beginning with the first element in superset.
|
1449 | * Uses a deep equality check.
|
1450 | *
|
1451 | * T Type of set values.
|
1452 | * @param superset Actual set of values.
|
1453 | * @param subset Potential contained set of values.
|
1454 | * @param message Message to display on error.
|
1455 | */
|
1456 | notIncludeDeepOrderedMembers<T>(superset: T[], subset: T[], message?: string): void;
|
1457 |
|
1458 | /**
|
1459 | * Asserts that subset is included in superset. Order is not take into account.
|
1460 | *
|
1461 | * T Type of set values.
|
1462 | * @param superset Actual set of values.
|
1463 | * @param subset Potential contained set of values.
|
1464 | * @param message Message to display on error.
|
1465 | */
|
1466 | includeMembers<T>(superset: T[], subset: T[], message?: string): void;
|
1467 |
|
1468 | /**
|
1469 | * Asserts that subset isn’t included in superset in any order.
|
1470 | * Uses a strict equality check (===). Duplicates are ignored.
|
1471 | *
|
1472 | * T Type of set values.
|
1473 | * @param superset Actual set of values.
|
1474 | * @param subset Potential not contained set of values.
|
1475 | * @param message Message to display on error.
|
1476 | */
|
1477 | notIncludeMembers<T>(superset: T[], subset: T[], message?: string): void;
|
1478 |
|
1479 | /**
|
1480 | * Asserts that subset is included in superset using deep equality checking.
|
1481 | * Order is not take into account.
|
1482 | *
|
1483 | * T Type of set values.
|
1484 | * @param superset Actual set of values.
|
1485 | * @param subset Potential contained set of values.
|
1486 | * @param message Message to display on error.
|
1487 | */
|
1488 | includeDeepMembers<T>(superset: T[], subset: T[], message?: string): void;
|
1489 |
|
1490 | /**
|
1491 | * Asserts that `subset` isn't included in `superset` in any order. Uses a
|
1492 | * deep equality check. Duplicates are ignored.
|
1493 | *
|
1494 | * assert.notIncludeDeepMembers([ { a: 1 }, { b: 2 }, { c: 3 } ], [ { b: 2 }, { f: 5 } ], 'not include deep members');
|
1495 | *
|
1496 | * T Type of set values.
|
1497 | * @param superset Actual set of values.
|
1498 | * @param subset Potential contained set of values.
|
1499 | * @param message Message to display on error.
|
1500 | */
|
1501 | notIncludeDeepMembers<T>(superset: T[], subset: T[], message?: string): void;
|
1502 |
|
1503 | /**
|
1504 | * Asserts that non-object, non-array value inList appears in the flat array list.
|
1505 | *
|
1506 | * T Type of list values.
|
1507 | * @param inList Value expected to be in the list.
|
1508 | * @param list List of values.
|
1509 | * @param message Message to display on error.
|
1510 | */
|
1511 | oneOf<T>(inList: T, list: T[], message?: string): void;
|
1512 |
|
1513 | /**
|
1514 | * Asserts that a function changes the value of a property.
|
1515 | *
|
1516 | * T Type of object.
|
1517 | * @param modifier Function to run.
|
1518 | * @param object Container object.
|
1519 | * @param property Property of object expected to be modified.
|
1520 | * @param message Message to display on error.
|
1521 | */
|
1522 | changes<T>(modifier: Function, object: T, property: string, message?: string): void;
|
1523 |
|
1524 | /**
|
1525 | * Asserts that a function changes the value of a property by an amount (delta).
|
1526 | *
|
1527 | * @param modifier function
|
1528 | * @param object or getter function
|
1529 | * @param property name _optional_
|
1530 | * @param change amount (delta)
|
1531 | * @param message _optional_
|
1532 | */
|
1533 | changesBy<T>(
|
1534 | modifier: Function,
|
1535 | object: T,
|
1536 | property: string,
|
1537 | change: number,
|
1538 | message?: string,
|
1539 | ): void;
|
1540 | changesBy<T>(modifier: Function, object: T, change: number, message?: string): void;
|
1541 |
|
1542 | /**
|
1543 | * Asserts that a function does not change the value of a property.
|
1544 | *
|
1545 | * T Type of object.
|
1546 | * @param modifier Function to run.
|
1547 | * @param object Container object.
|
1548 | * @param property Property of object expected not to be modified.
|
1549 | * @param message Message to display on error.
|
1550 | */
|
1551 | doesNotChange<T>(modifier: Function, object: T, property: string, message?: string): void;
|
1552 |
|
1553 | /**
|
1554 | * Asserts that a function increases an object property.
|
1555 | *
|
1556 | * T Type of object.
|
1557 | * @param modifier Function to run.
|
1558 | * @param object Container object.
|
1559 | * @param property Property of object expected to be increased.
|
1560 | * @param message Message to display on error.
|
1561 | */
|
1562 | increases<T>(modifier: Function, object: T, property: string, message?: string): void;
|
1563 |
|
1564 | /**
|
1565 | * Asserts that a function increases a numeric object property or a function's return value by an amount (delta).
|
1566 | *
|
1567 | * T Type of object or function.
|
1568 | * @param modifier function
|
1569 | * @param object or getter function
|
1570 | * @param property name _optional_
|
1571 | * @param change amount (delta)
|
1572 | * @param message _optional_
|
1573 | */
|
1574 | increasesBy<T>(
|
1575 | modifier: Function,
|
1576 | object: T,
|
1577 | property: string,
|
1578 | change: number,
|
1579 | message?: string,
|
1580 | ): void;
|
1581 | increasesBy<T>(modifier: Function, object: T, change: number, message?: string): void;
|
1582 |
|
1583 | /**
|
1584 | * Asserts that a function does not increase an object property.
|
1585 | *
|
1586 | * T Type of object.
|
1587 | * @param modifier Function to run.
|
1588 | * @param object Container object.
|
1589 | * @param property Property of object expected not to be increased.
|
1590 | * @param message Message to display on error.
|
1591 | */
|
1592 | doesNotIncrease<T>(modifier: Function, object: T, property: string, message?: string): void;
|
1593 |
|
1594 | /**
|
1595 | * Asserts that a function does not increase a numeric object property or function's return value by an amount (delta).
|
1596 | *
|
1597 | * T Type of object or function.
|
1598 | * @param modifier function
|
1599 | * @param object or getter function
|
1600 | * @param property name _optional_
|
1601 | * @param change amount (delta)
|
1602 | * @param message _optional_
|
1603 | */
|
1604 |
|
1605 | increasesButNotBy<T>(
|
1606 | modifier: Function,
|
1607 | object: T,
|
1608 | property: string,
|
1609 | change: number,
|
1610 | message?: string,
|
1611 | ): void;
|
1612 | increasesButNotBy<T>(modifier: Function, object: T, change: number, message?: string): void;
|
1613 |
|
1614 | /**
|
1615 | * Asserts that a function decreases an object property.
|
1616 | *
|
1617 | * T Type of object.
|
1618 | * @param modifier Function to run.
|
1619 | * @param object Container object.
|
1620 | * @param property Property of object expected to be decreased.
|
1621 | * @param message Message to display on error.
|
1622 | */
|
1623 | decreases<T>(modifier: Function, object: T, property: string, message?: string): void;
|
1624 |
|
1625 | /**
|
1626 | * Asserts that a function decreases a numeric object property or a function's return value by an amount (delta)
|
1627 | *
|
1628 | * T Type of object or function.
|
1629 | * @param modifier function
|
1630 | * @param object or getter function
|
1631 | * @param property name _optional_
|
1632 | * @param change amount (delta)
|
1633 | * @param message _optional_
|
1634 | */
|
1635 |
|
1636 | decreasesBy<T>(
|
1637 | modifier: Function,
|
1638 | object: T,
|
1639 | property: string,
|
1640 | change: number,
|
1641 | message?: string,
|
1642 | ): void;
|
1643 | decreasesBy<T>(modifier: Function, object: T, change: number, message?: string): void;
|
1644 |
|
1645 | /**
|
1646 | * Asserts that a function does not decrease an object property.
|
1647 | *
|
1648 | * T Type of object.
|
1649 | * @param modifier Function to run.
|
1650 | * @param object Container object.
|
1651 | * @param property Property of object expected not to be decreased.
|
1652 | * @param message Message to display on error.
|
1653 | */
|
1654 | doesNotDecrease<T>(modifier: Function, object: T, property: string, message?: string): void;
|
1655 |
|
1656 | /**
|
1657 | * Asserts that a function does not decreases a numeric object property or a function's return value by an amount (delta)
|
1658 | *
|
1659 | * T Type of object or function.
|
1660 | * @param modifier function
|
1661 | * @param object or getter function
|
1662 | * @param property name _optional_
|
1663 | * @param change amount (delta)
|
1664 | * @param message _optional_
|
1665 | */
|
1666 |
|
1667 | doesNotDecreaseBy<T>(
|
1668 | modifier: Function,
|
1669 | object: T,
|
1670 | property: string,
|
1671 | change: number,
|
1672 | message?: string,
|
1673 | ): void;
|
1674 | doesNotDecreaseBy<T>(modifier: Function, object: T, change: number, message?: string): void;
|
1675 |
|
1676 | /**
|
1677 | * Asserts that a function does not decreases a numeric object property or a function's return value by an amount (delta)
|
1678 | *
|
1679 | * T Type of object or function.
|
1680 | * @param modifier function
|
1681 | * @param object or getter function
|
1682 | * @param property name _optional_
|
1683 | * @param change amount (delta)
|
1684 | * @param message _optional_
|
1685 | */
|
1686 |
|
1687 | decreasesButNotBy<T>(
|
1688 | modifier: Function,
|
1689 | object: T,
|
1690 | property: string,
|
1691 | change: number,
|
1692 | message?: string,
|
1693 | ): void;
|
1694 | decreasesButNotBy<T>(modifier: Function, object: T, change: number, message?: string): void;
|
1695 |
|
1696 | /**
|
1697 | * Asserts if value is not a false value, and throws if it is a true value.
|
1698 | *
|
1699 | * T Type of object.
|
1700 | * @param object Actual value.
|
1701 | * @param message Message to display on error.
|
1702 | * @remarks This is added to allow for chai to be a drop-in replacement for
|
1703 | * Node’s assert class.
|
1704 | */
|
1705 | ifError<T>(object: T, message?: string): void;
|
1706 |
|
1707 | /**
|
1708 | * Asserts that object is extensible (can have new properties added to it).
|
1709 | *
|
1710 | * T Type of object
|
1711 | * @param object Actual value.
|
1712 | * @param message Message to display on error.
|
1713 | */
|
1714 | isExtensible<T>(object: T, message?: string): void;
|
1715 |
|
1716 | /**
|
1717 | * Asserts that object is extensible (can have new properties added to it).
|
1718 | *
|
1719 | * T Type of object
|
1720 | * @param object Actual value.
|
1721 | * @param message Message to display on error.
|
1722 | */
|
1723 | extensible<T>(object: T, message?: string): void;
|
1724 |
|
1725 | /**
|
1726 | * Asserts that object is not extensible.
|
1727 | *
|
1728 | * T Type of object
|
1729 | * @param object Actual value.
|
1730 | * @param message Message to display on error.
|
1731 | */
|
1732 | isNotExtensible<T>(object: T, message?: string): void;
|
1733 |
|
1734 | /**
|
1735 | * Asserts that object is not extensible.
|
1736 | *
|
1737 | * T Type of object
|
1738 | * @param object Actual value.
|
1739 | * @param message Message to display on error.
|
1740 | */
|
1741 | notExtensible<T>(object: T, message?: string): void;
|
1742 |
|
1743 | /**
|
1744 | * Asserts that object is sealed (can have new properties added to it
|
1745 | * and its existing properties cannot be removed).
|
1746 | *
|
1747 | * T Type of object
|
1748 | * @param object Actual value.
|
1749 | * @param message Message to display on error.
|
1750 | */
|
1751 | isSealed<T>(object: T, message?: string): void;
|
1752 |
|
1753 | /**
|
1754 | * Asserts that object is sealed (can have new properties added to it
|
1755 | * and its existing properties cannot be removed).
|
1756 | *
|
1757 | * T Type of object
|
1758 | * @param object Actual value.
|
1759 | * @param message Message to display on error.
|
1760 | */
|
1761 | sealed<T>(object: T, message?: string): void;
|
1762 |
|
1763 | /**
|
1764 | * Asserts that object is not sealed.
|
1765 | *
|
1766 | * T Type of object
|
1767 | * @param object Actual value.
|
1768 | * @param message Message to display on error.
|
1769 | */
|
1770 | isNotSealed<T>(object: T, message?: string): void;
|
1771 |
|
1772 | /**
|
1773 | * Asserts that object is not sealed.
|
1774 | *
|
1775 | * T Type of object
|
1776 | * @param object Actual value.
|
1777 | * @param message Message to display on error.
|
1778 | */
|
1779 | notSealed<T>(object: T, message?: string): void;
|
1780 |
|
1781 | /**
|
1782 | * Asserts that object is frozen (cannot have new properties added to it
|
1783 | * and its existing properties cannot be removed).
|
1784 | *
|
1785 | * T Type of object
|
1786 | * @param object Actual value.
|
1787 | * @param message Message to display on error.
|
1788 | */
|
1789 | isFrozen<T>(object: T, message?: string): void;
|
1790 |
|
1791 | /**
|
1792 | * Asserts that object is frozen (cannot have new properties added to it
|
1793 | * and its existing properties cannot be removed).
|
1794 | *
|
1795 | * T Type of object
|
1796 | * @param object Actual value.
|
1797 | * @param message Message to display on error.
|
1798 | */
|
1799 | frozen<T>(object: T, message?: string): void;
|
1800 |
|
1801 | /**
|
1802 | * Asserts that object is not frozen (cannot have new properties added to it
|
1803 | * and its existing properties cannot be removed).
|
1804 | *
|
1805 | * T Type of object
|
1806 | * @param object Actual value.
|
1807 | * @param message Message to display on error.
|
1808 | */
|
1809 | isNotFrozen<T>(object: T, message?: string): void;
|
1810 |
|
1811 | /**
|
1812 | * Asserts that object is not frozen (cannot have new properties added to it
|
1813 | * and its existing properties cannot be removed).
|
1814 | *
|
1815 | * T Type of object
|
1816 | * @param object Actual value.
|
1817 | * @param message Message to display on error.
|
1818 | */
|
1819 | notFrozen<T>(object: T, message?: string): void;
|
1820 |
|
1821 | /**
|
1822 | * Asserts that the target does not contain any values. For arrays and
|
1823 | * strings, it checks the length property. For Map and Set instances, it
|
1824 | * checks the size property. For non-function objects, it gets the count
|
1825 | * of own enumerable string keys.
|
1826 | *
|
1827 | * T Type of object
|
1828 | * @param object Actual value.
|
1829 | * @param message Message to display on error.
|
1830 | */
|
1831 | isEmpty<T>(object: T, message?: string): void;
|
1832 |
|
1833 | /**
|
1834 | * Asserts that the target contains values. For arrays and strings, it checks
|
1835 | * the length property. For Map and Set instances, it checks the size property.
|
1836 | * For non-function objects, it gets the count of own enumerable string keys.
|
1837 | *
|
1838 | * T Type of object.
|
1839 | * @param object Object to test.
|
1840 | * @param message Message to display on error.
|
1841 | */
|
1842 | isNotEmpty<T>(object: T, message?: string): void;
|
1843 |
|
1844 | /**
|
1845 | * Asserts that `object` has at least one of the `keys` provided.
|
1846 | * You can also provide a single object instead of a `keys` array and its keys
|
1847 | * will be used as the expected set of keys.
|
1848 | *
|
1849 | * T Type of object.
|
1850 | * @param object Object to test.
|
1851 | * @param keys Keys to check
|
1852 | * @param message Message to display on error.
|
1853 | */
|
1854 | hasAnyKeys<T>(object: T, keys: Array<Object | string> | { [key: string]: any }, message?: string): void;
|
1855 |
|
1856 | /**
|
1857 | * Asserts that `object` has all and only all of the `keys` provided.
|
1858 | * You can also provide a single object instead of a `keys` array and its keys
|
1859 | * will be used as the expected set of keys.
|
1860 | *
|
1861 | * T Type of object.
|
1862 | * @param object Object to test.
|
1863 | * @param keys Keys to check
|
1864 | * @param message Message to display on error.
|
1865 | */
|
1866 | hasAllKeys<T>(object: T, keys: Array<Object | string> | { [key: string]: any }, message?: string): void;
|
1867 |
|
1868 | /**
|
1869 | * Asserts that `object` has all of the `keys` provided but may have more keys not listed.
|
1870 | * You can also provide a single object instead of a `keys` array and its keys
|
1871 | * will be used as the expected set of keys.
|
1872 | *
|
1873 | * T Type of object.
|
1874 | * @param object Object to test.
|
1875 | * @param keys Keys to check
|
1876 | * @param message Message to display on error.
|
1877 | */
|
1878 | containsAllKeys<T>(
|
1879 | object: T,
|
1880 | keys: Array<Object | string> | { [key: string]: any },
|
1881 | message?: string,
|
1882 | ): void;
|
1883 |
|
1884 | /**
|
1885 | * Asserts that `object` has none of the `keys` provided.
|
1886 | * You can also provide a single object instead of a `keys` array and its keys
|
1887 | * will be used as the expected set of keys.
|
1888 | *
|
1889 | * T Type of object.
|
1890 | * @param object Object to test.
|
1891 | * @param keys Keys to check
|
1892 | * @param message Message to display on error.
|
1893 | */
|
1894 | doesNotHaveAnyKeys<T>(
|
1895 | object: T,
|
1896 | keys: Array<Object | string> | { [key: string]: any },
|
1897 | message?: string,
|
1898 | ): void;
|
1899 |
|
1900 | /**
|
1901 | * Asserts that `object` does not have at least one of the `keys` provided.
|
1902 | * You can also provide a single object instead of a `keys` array and its keys
|
1903 | * will be used as the expected set of keys.
|
1904 | *
|
1905 | * T Type of object.
|
1906 | * @param object Object to test.
|
1907 | * @param keys Keys to check
|
1908 | * @param message Message to display on error.
|
1909 | */
|
1910 | doesNotHaveAllKeys<T>(
|
1911 | object: T,
|
1912 | keys: Array<Object | string> | { [key: string]: any },
|
1913 | message?: string,
|
1914 | ): void;
|
1915 |
|
1916 | /**
|
1917 | * Asserts that `object` has at least one of the `keys` provided.
|
1918 | * Since Sets and Maps can have objects as keys you can use this assertion to perform
|
1919 | * a deep comparison.
|
1920 | * You can also provide a single object instead of a `keys` array and its keys
|
1921 | * will be used as the expected set of keys.
|
1922 | *
|
1923 | * T Type of object.
|
1924 | * @param object Object to test.
|
1925 | * @param keys Keys to check
|
1926 | * @param message Message to display on error.
|
1927 | */
|
1928 | hasAnyDeepKeys<T>(object: T, keys: Array<Object | string> | { [key: string]: any }, message?: string): void;
|
1929 |
|
1930 | /**
|
1931 | * Asserts that `object` has all and only all of the `keys` provided.
|
1932 | * Since Sets and Maps can have objects as keys you can use this assertion to perform
|
1933 | * a deep comparison.
|
1934 | * You can also provide a single object instead of a `keys` array and its keys
|
1935 | * will be used as the expected set of keys.
|
1936 | *
|
1937 | * T Type of object.
|
1938 | * @param object Object to test.
|
1939 | * @param keys Keys to check
|
1940 | * @param message Message to display on error.
|
1941 | */
|
1942 | hasAllDeepKeys<T>(object: T, keys: Array<Object | string> | { [key: string]: any }, message?: string): void;
|
1943 |
|
1944 | /**
|
1945 | * Asserts that `object` contains all of the `keys` provided.
|
1946 | * Since Sets and Maps can have objects as keys you can use this assertion to perform
|
1947 | * a deep comparison.
|
1948 | * You can also provide a single object instead of a `keys` array and its keys
|
1949 | * will be used as the expected set of keys.
|
1950 | *
|
1951 | * T Type of object.
|
1952 | * @param object Object to test.
|
1953 | * @param keys Keys to check
|
1954 | * @param message Message to display on error.
|
1955 | */
|
1956 | containsAllDeepKeys<T>(
|
1957 | object: T,
|
1958 | keys: Array<Object | string> | { [key: string]: any },
|
1959 | message?: string,
|
1960 | ): void;
|
1961 |
|
1962 | /**
|
1963 | * Asserts that `object` contains all of the `keys` provided.
|
1964 | * Since Sets and Maps can have objects as keys you can use this assertion to perform
|
1965 | * a deep comparison.
|
1966 | * You can also provide a single object instead of a `keys` array and its keys
|
1967 | * will be used as the expected set of keys.
|
1968 | *
|
1969 | * T Type of object.
|
1970 | * @param object Object to test.
|
1971 | * @param keys Keys to check
|
1972 | * @param message Message to display on error.
|
1973 | */
|
1974 | doesNotHaveAnyDeepKeys<T>(
|
1975 | object: T,
|
1976 | keys: Array<Object | string> | { [key: string]: any },
|
1977 | message?: string,
|
1978 | ): void;
|
1979 |
|
1980 | /**
|
1981 | * Asserts that `object` contains all of the `keys` provided.
|
1982 | * Since Sets and Maps can have objects as keys you can use this assertion to perform
|
1983 | * a deep comparison.
|
1984 | * You can also provide a single object instead of a `keys` array and its keys
|
1985 | * will be used as the expected set of keys.
|
1986 | *
|
1987 | * T Type of object.
|
1988 | * @param object Object to test.
|
1989 | * @param keys Keys to check
|
1990 | * @param message Message to display on error.
|
1991 | */
|
1992 | doesNotHaveAllDeepKeys<T>(
|
1993 | object: T,
|
1994 | keys: Array<Object | string> | { [key: string]: any },
|
1995 | message?: string,
|
1996 | ): void;
|
1997 |
|
1998 | /**
|
1999 | * Asserts that object has a direct or inherited property named by property,
|
2000 | * which can be a string using dot- and bracket-notation for nested reference.
|
2001 | *
|
2002 | * T Type of object.
|
2003 | * @param object Object to test.
|
2004 | * @param property Property to test.
|
2005 | * @param message Message to display on error.
|
2006 | */
|
2007 | nestedProperty<T>(object: T, property: string, message?: string): void;
|
2008 |
|
2009 | /**
|
2010 | * Asserts that object does not have a property named by property,
|
2011 | * which can be a string using dot- and bracket-notation for nested reference.
|
2012 | * The property cannot exist on the object nor anywhere in its prototype chain.
|
2013 | *
|
2014 | * T Type of object.
|
2015 | * @param object Object to test.
|
2016 | * @param property Property to test.
|
2017 | * @param message Message to display on error.
|
2018 | */
|
2019 | notNestedProperty<T>(object: T, property: string, message?: string): void;
|
2020 |
|
2021 | /**
|
2022 | * Asserts that object has a property named by property with value given by value.
|
2023 | * property can use dot- and bracket-notation for nested reference. Uses a strict equality check (===).
|
2024 | *
|
2025 | * T Type of object.
|
2026 | * @param object Object to test.
|
2027 | * @param property Property to test.
|
2028 | * @param value Value to test.
|
2029 | * @param message Message to display on error.
|
2030 | */
|
2031 | nestedPropertyVal<T>(object: T, property: string, value: any, message?: string): void;
|
2032 |
|
2033 | /**
|
2034 | * Asserts that object does not have a property named by property with value given by value.
|
2035 | * property can use dot- and bracket-notation for nested reference. Uses a strict equality check (===).
|
2036 | *
|
2037 | * T Type of object.
|
2038 | * @param object Object to test.
|
2039 | * @param property Property to test.
|
2040 | * @param value Value to test.
|
2041 | * @param message Message to display on error.
|
2042 | */
|
2043 | notNestedPropertyVal<T>(object: T, property: string, value: any, message?: string): void;
|
2044 |
|
2045 | /**
|
2046 | * Asserts that object has a property named by property with a value given by value.
|
2047 | * property can use dot- and bracket-notation for nested reference. Uses a deep equality check.
|
2048 | *
|
2049 | * T Type of object.
|
2050 | * @param object Object to test.
|
2051 | * @param property Property to test.
|
2052 | * @param value Value to test.
|
2053 | * @param message Message to display on error.
|
2054 | */
|
2055 | deepNestedPropertyVal<T>(object: T, property: string, value: any, message?: string): void;
|
2056 |
|
2057 | /**
|
2058 | * Asserts that object does not have a property named by property with value given by value.
|
2059 | * property can use dot- and bracket-notation for nested reference. Uses a deep equality check.
|
2060 | *
|
2061 | * T Type of object.
|
2062 | * @param object Object to test.
|
2063 | * @param property Property to test.
|
2064 | * @param value Value to test.
|
2065 | * @param message Message to display on error.
|
2066 | */
|
2067 | notDeepNestedPropertyVal<T>(object: T, property: string, value: any, message?: string): void;
|
2068 | }
|
2069 |
|
2070 | export interface Config {
|
2071 | /**
|
2072 | * Default: false
|
2073 | */
|
2074 | includeStack: boolean;
|
2075 |
|
2076 | /**
|
2077 | * Default: true
|
2078 | */
|
2079 | showDiff: boolean;
|
2080 |
|
2081 | /**
|
2082 | * Default: 40
|
2083 | */
|
2084 | truncateThreshold: number;
|
2085 |
|
2086 | /**
|
2087 | * Default: true
|
2088 | */
|
2089 | useProxy: boolean;
|
2090 |
|
2091 | /**
|
2092 | * Default: ['then', 'catch', 'inspect', 'toJSON']
|
2093 | */
|
2094 | proxyExcludedKeys: string[];
|
2095 |
|
2096 | deepEqual: <L, R>(expected: L, actual: R) => void;
|
2097 | }
|
2098 |
|
2099 | export class AssertionError {
|
2100 | constructor(message: string, _props?: any, ssf?: Function);
|
2101 | name: string;
|
2102 | message: string;
|
2103 | showDiff: boolean;
|
2104 | stack: string;
|
2105 | }
|
2106 | }
|
2107 | }
|
2108 |
|
2109 | export function use(fn: Chai.ChaiPlugin): Chai.ChaiStatic;
|
2110 |
|
2111 | export const util: Chai.ChaiUtils;
|
2112 | export const config: Chai.Config;
|
2113 | export const Assertion: Chai.AssertionStatic;
|
2114 | export function should(): Chai.Should;
|
2115 | export function Should(): Chai.Should;
|
2116 | export const assert: Chai.AssertStatic;
|
2117 | export const expect: Chai.ExpectStatic;
|
2118 |
|
2119 | declare global {
|
2120 | interface Object {
|
2121 | should: Chai.Assertion;
|
2122 | }
|
2123 | }
|