Skip to content

@sapui5/ts-types-esm - opaQunit should be an overload & async option should be optional #308

Open
@DetachHead

Description

@DetachHead
declare module "sap/ui/test/opaQunit" {
  export default function opaQunit(
    /**
     * name of the QUnit test.
     */
    testName: string,
    /**
     * integer value only supported in QUnit v1.x: denotes how many assertions are expected to be made in the
     * test. If a function is passed instead, it is considered to be the callback parameter
     */
    expected: int | Function,
    /**
     * the test function. Expects 3 arguments, in order: {@link sap.ui.test.Opa.config}.arrangements, {@link
     * sap.ui.test.Opa.config}.actions, {@link sap.ui.test.Opa.config}.assertions. These arguments will be prefilled
     * by OPA
     */
    callback: Function,
    /**
     * available only in QUnit v1.x. Indicates whether the test is asynchronous. False by default.
     */
    async: boolean
  ): void;
}

if that documentation is correct, the definition should instead be something like:

declare module 'sap/ui/test/opaQunit' {
    export default function opaQunit(
        testName: string,
        expected: int,
        callback: Function,
        async?: boolean,
    ): void
    export default function opaQunit(testName: string, callback: Function, async?: boolean): void
}

(assuming async becomes the third argument if a callback is provided as the second, i'm not sure how the impl handles it)

Metadata

Metadata

Assignees

No one assigned

    Labels

    typesES modules types (recommended)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions