mirror of
https://github.com/hanzo-fi/stack.git
synced 2026-10-30 20:34:43 +00:00
24 lines
629 B
TypeScript
24 lines
629 B
TypeScript
import {ClientMapping, withClient} from "../client";
|
|
import {fromServerVersion} from "../client/base";
|
|
|
|
export * from './versions';
|
|
export * from './expectations';
|
|
|
|
export interface MatrixTest {
|
|
serverVersion: string;
|
|
clientVersion: keyof ClientMapping;
|
|
}
|
|
|
|
export const withMatrix = <T extends MatrixTest>(
|
|
tests: T[],
|
|
callback: (t: T, client: ClientMapping[T['clientVersion']]) => void,
|
|
) => {
|
|
for (const test of tests) {
|
|
fromServerVersion(test.serverVersion, () => {
|
|
withClient(test.clientVersion, client => {
|
|
callback(test, client);
|
|
});
|
|
});
|
|
}
|
|
};
|