`@sapui5/ts-types-esm` - `opaQunit` should be an overload & `async` option should be optional
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)
the Given, When and Then in the callback should also be typed (so that this example works), it probably needs to use a generic but i'm not familiar enough with Opa5 and opaQunit to provide a solution
Same like #306 - testing related code wasn't in focus of TS API support so far.
Actually, this is the same issue that I more generically reported as https://github.com/SAP/ui5-typescript/issues/327: permutations are missing for a few UI5 API objects, which are no proper classes, interfaces or namespaces. We understand where in the code they are accidentally not handled, but have not done a fix yet.
Issue is understood and fixed in the internal generator repo. Which type definitions version has the fix depends on when the fixed version is used in the internal build.