• Test function for writing test cases. Provides test context and logging.

    Parameters

    • name: string

      The name of the test case

    • fn: () => void | Promise<void>

      The test function to execute

    Returns void

    // Basic test case
    test('should add numbers correctly', () => {
    assert.equal(1 + 1, 2);
    });

    // Async test case
    test('should handle async operations', async () => {
    const result = await someAsyncFunction();
    assert.equal(result, expectedValue);
    });

    // Skip a test case
    test.skip('feature not implemented', () => {
    // Test code that will be skipped
    });

Methods

Methods

  • Parameters

    • name: string
    • fn: () => void | Promise<void>

    Returns void