44 lines
930 B
TypeScript
44 lines
930 B
TypeScript
import { Assertion } from '../smartexpect.classes.assertion.js';
|
|
|
|
/**
|
|
* Namespace for array-specific matchers
|
|
*/
|
|
export class ArrayMatchers<T> {
|
|
constructor(private assertion: Assertion<T[]>) {}
|
|
|
|
toBeArray() {
|
|
return this.assertion.toBeArray();
|
|
}
|
|
|
|
toHaveLength(length: number) {
|
|
return this.assertion.toHaveLength(length);
|
|
}
|
|
|
|
toContain(item: T) {
|
|
return this.assertion.toContain(item);
|
|
}
|
|
|
|
toContainEqual(item: T) {
|
|
return this.assertion.toContainEqual(item);
|
|
}
|
|
|
|
toContainAll(items: T[]) {
|
|
return this.assertion.toContainAll(items);
|
|
}
|
|
|
|
toExclude(item: T) {
|
|
return this.assertion.toExclude(item);
|
|
}
|
|
|
|
toBeEmptyArray() {
|
|
return this.assertion.toBeEmptyArray();
|
|
}
|
|
|
|
toHaveLengthGreaterThan(length: number) {
|
|
return this.assertion.toHaveLengthGreaterThan(length);
|
|
}
|
|
|
|
toHaveLengthLessThan(length: number) {
|
|
return this.assertion.toHaveLengthLessThan(length);
|
|
}
|
|
} |