import { Matchers,NumberMatchers } from './Matchers.uts' export const describes = new Map() export class Result { total = 0 passed: string[] = [] failed: string[] = [] } let result: Result = new Result() export function describe(name: string, fn: () => void): Result { result = new Result() describes.set(name, result) fn() return result } export function test(name: string, fn: () => void) { try { fn() // console.log('push....',name) result.passed.push(name) // console.log('push....',result.passed.length) } catch (e) { result.failed.push(`${name}:\n${(e as Error).message}`) } result.total++ } export function expect(value: T): Matchers { return new Matchers(value); } export function expectNumber(value: number): NumberMatchers { return new NumberMatchers(value); }