VS Code API
    Preparing search index...

    Interface TestItemCollection

    Collection of test items, found in TestItem.children and TestController.items.

    interface TestItemCollection {
        size: number;
        "[iterator]"(): Iterator<[id: string, testItem: TestItem], any, any>;
        add(item: TestItem): void;
        delete(itemId: string): void;
        forEach(
            callback: (item: TestItem, collection: TestItemCollection) => unknown,
            thisArg?: any,
        ): void;
        get(itemId: string): TestItem | undefined;
        replace(items: readonly TestItem[]): void;
    }

    Hierarchy

    Index

    Properties

    size: number

    Gets the number of items in the collection.

    Methods

    • Returns Iterator<[id: string, testItem: TestItem], any, any>

    • Adds the test item to the children. If an item with the same ID already exists, it'll be replaced.

      Parameters

      Returns void

    • Removes a single test item from the collection.

      Parameters

      • itemId: string

        Item ID to delete.

      Returns void

    • Iterate over each entry in this collection.

      Parameters

      • callback: (item: TestItem, collection: TestItemCollection) => unknown

        Function to execute for each entry.

      • OptionalthisArg: any

        The this context used when invoking the handler function.

      Returns void

    • Efficiently gets a test item by ID, if it exists, in the children.

      Parameters

      • itemId: string

        Item ID to get.

      Returns TestItem | undefined

      The found item or undefined if it does not exist.

    • Replaces the items stored by the collection.

      Parameters

      • items: readonly TestItem[]

        Items to store.

      Returns void