feat(generics): Improve assertion and matcher type definitions by adding execution mode generics for better async/sync support

This commit is contained in:
2025-04-29 12:08:57 +00:00
parent 81bd8bfb13
commit 8cb70b6afe
12 changed files with 85 additions and 60 deletions

View File

@@ -1,11 +1,12 @@
import { Assertion } from '../smartexpect.classes.assertion.js';
import * as plugins from '../plugins.js';
import type { TExecutionType } from '../types.js';
/**
* Namespace for array-specific matchers
*/
export class ArrayMatchers<T> {
constructor(private assertion: Assertion<T[]>) {}
export class ArrayMatchers<T, M extends TExecutionType> {
constructor(private assertion: Assertion<T[], M>) {}
toBeArray() {
return this.assertion.customAssertion(