UNPKG

t6

Version:

Lightweight assertion testing framework

94 lines (93 loc) 4.19 kB
/** * Return the number of the test that last completed. * @returns The current test number. */ export declare function getTestNumber(): number; /** * Expect a test to return **true**. * @param test A test that returns a boolean result * @param message The exception message to show if * an unexpected result was found. If not set, will * display a default message for this type of test. */ export declare function isTrue(test: boolean, message?: string): void; /** * Expect a test to return **false**. * @param test A test that returns a boolean result * @param message The exception message to show if * an unexpected result was found. If not set, will * display a default message for this type of test. */ export declare function isFalse(test: boolean, message?: string): void; /** * Expect the test string to be **identical** to the expected string. * @param test A test that returns a string result * @param expect The expected string to use for comparison * @param message The exception message to show if * an unexpected result was found. If not set, will * display a default message for this type of test. */ export declare function is(test: string, expect: string, message?: string): void; /** * Expect the test string to be **different** than the expected string. * @param test A test that returns a string result * @param expect The expected string to use for comparison * @param message The exception message to show if * an unexpected result was found. If not set, will * display a default message for this type of test. */ export declare function not(test: string, expect: string, message?: string): void; /** * Expect the test to **be equal** to the expected value. * @param test A test that returns a numeric result * @param expect The expected number to use for comparison * @param message The exception message to show if * an unexpected result was found. If not set, will * display a default message for this type of test. */ export declare function eq(test: number, expect: number, message?: string): void; /** * Expect the test to **not be equal** to the expected value. * @param test A test that returns a numeric result * @param expect The expected number to use for comparison * @param message The exception message to show if * an unexpected result was found. If not set, will * display a default message for this type of test. */ export declare function ne(test: number, expect: number, message?: string): void; /** * Expect the test to be strictly **greater than** the expected value. * @param test A test that returns a numeric result * @param expect The expected number to use for comparison * @param message The exception message to show if * an unexpected result was found. If not set, will * display a default message for this type of test. */ export declare function gt(test: number, expect: number, message?: string): void; /** * Expect the test to be strictly **less than** the expected value. * @param test A test that returns a numeric result * @param expect The expected number to use for comparison * @param message The exception message to show if * an unexpected result was found. If not set, will * display a default message for this type of test. */ export declare function lt(test: number, expect: number, message?: string): void; /** * Expect the test to be **greater than or equal to** the expected value. * @param test A test that returns a numeric result * @param expect The expected number to use for comparison * @param message The exception message to show if * an unexpected result was found. If not set, will * display a default message for this type of test. */ export declare function ge(test: number, expect: number, message?: string): void; /** * Expect the test to be **less than or equal to** the expected value. * @param test A test that returns a numeric result * @param expect The expected number to use for comparison * @param message The exception message to show if * an unexpected result was found. If not set, will * display a default message for this type of test. */ export declare function le(test: number, expect: number, message?: string): void;