import { ITestBase } from '../common/mod.ts'; import { stdAssert } from './deps.ts'; const { assertEquals, assertExists, assertInstanceOf, AssertionError, assertNotEquals, assertStrictEquals, } = stdAssert; class TestBase implements ITestBase { test(name: string, fn: () => void): void { return Deno.test(name, fn); } assertEquals(actual: unknown, expected: unknown): void { return assertEquals(actual, expected); } assertStrictEquals(actual: unknown, expected: unknown) { return assertStrictEquals(actual, expected); } assertNotEquals(actual: unknown, expected: unknown): void { return assertNotEquals(actual, expected); } assertExists(actual: unknown, msg?: string): void { return assertExists(actual, msg); } assertInstanceOf(actual: unknown, expectedType: any): void { return assertInstanceOf(actual, expectedType); } assertTrue(actual: boolean): void { if (actual !== true) { throw new AssertionError(`actual: "${actual}" expected to be true"`); } } assertFalse(actual: boolean): void { if (actual !== false) { throw new AssertionError(`actual: "${actual}" expected to be false"`); } } } const testBase = new TestBase(); export default testBase;