UNPKG

@drozdik.m/unit-test

Version:

Unit test with test cases with Assert functions. Simple and easy.

38 lines (37 loc) 964 B
export declare abstract class TestCase { private name; protected error: Error; protected success: boolean; protected useCaseFunction: Function; protected isDone: boolean; /** * Creates new instance of TestCase * @param name Name of the test case * @param useCaseFunction Function to run */ constructor(name: string, useCaseFunction: Function); /** * Runs the test case function * */ abstract Run(): void; /** * Returns true if the test is running, else false * */ abstract IsRunning(): boolean; /** * Returns error is some caught, else null * */ Error(): Error; /** * Returns true if test case ran successfully * */ Success(): boolean; /** * Returns true if the test is done, else false * */ IsDone(): boolean; /** * Returns name of this test case * */ Name(): string; }