assertthat
Version:
assertthat provides fluent TDD.
25 lines (24 loc) • 809 B
TypeScript
import { CombinedAssertions } from './assertions/combined/CombinedAssertions';
declare type AssertThat = (<TValue>(value: TValue) => ({
is: CombinedAssertions<TValue> & {
not: CombinedAssertions<TValue>;
};
})) & {
eachElementOf: <TValue>(value: TValue) => TValue extends Set<infer TContent> ? {
is: CombinedAssertions<TContent> & {
not: CombinedAssertions<TContent>;
};
} : TValue extends Map<any, infer TContent> ? {
is: CombinedAssertions<TContent> & {
not: CombinedAssertions<TContent>;
};
} : TValue extends (infer TContent)[] ? {
is: CombinedAssertions<TContent> & {
not: CombinedAssertions<TContent>;
};
} : never;
};
declare const assert: {
that: AssertThat;
};
export { assert };