test - huang2002/3h-test GitHub Wiki

test

/**
 * Type of test case callbacks.
 */
type TestCaseCallback = (context: TestContext) => void | PromiseLike<void>;

/**
 * Type of test case descriptions.
 */
interface TestCaseDescription {
    options: TestContextOptions;
    callback: TestCaseCallback;
}

/**
 * Type of test cases.
 */
interface TestCases {
    [name: string]: TestCaseCallback | TestCaseDescription;
}

/**
 * Type of test options.
 */
type TestOptions = Partial<{
    /**
     * Default options for test contexts.
     */
    defaultOptions: TestContextOptions | null;
    /**
      * Whether to print detailed info.
      * @default true
      */
    verbose: boolean;
    /**
     * Only run tests whose names are listed here.
     * Omit this option to run all tests.
     */
    include: string[];
    /**
     * Skip tests whose names are listed here.
     */
    exclude: string[];
}>;

/**
 * Run the given tests and print results to console.
 * (Note that the options in the test case description
 * will override the default options.)
 */
const test: (options: TestOptions | null, testCases: TestCases) => Promise<void>;
⚠️ **GitHub.com Fallback** ⚠️