SAP / ui5-typescript

Tooling to enable TypeScript support in SAPUI5/OpenUI5 projects
https://sap.github.io/ui5-typescript
Apache License 2.0
202 stars 28 forks source link

`@sapui5/ts-types-esm` - missing types for `jsUnitTestSuite`? #310

Open DetachHead opened 3 years ago

DetachHead commented 3 years ago

ie. how would i convert this to typescript?

window.suite = function() {
    "use strict";

    var oSuite = new parent.jsUnitTestSuite(),
        sContextPath = location.pathname.substring(0, location.pathname.lastIndexOf("/") + 1);

    oSuite.addTestPage(sContextPath + "unit/unitTests.qunit.html");
    oSuite.addTestPage(sContextPath + "integration/opaTests.qunit.html");

    return oSuite;
};
petermuessig commented 3 years ago

Same like #306 - testing related code wasn't in focus of TS API support so far.

BTW: the jsUnitTestSuite is really legacy code - I don't think we should propagate it further. This is related to one of the early stuff from more than a decade back... 😁 There is a new more declarative way, which we didn't describe so far yet, e.g.:

https://github.com/SAP/openui5/blob/master/src/sap.f/test/sap/f/qunit/testsuite.qunit.html https://github.com/SAP/openui5/blob/master/src/sap.f/test/sap/f/qunit/testsuite.qunit.js

petermuessig commented 2 years ago

The usage of the old testsuite code is related to the following "Worklist" walkthrough example: https://github.com/SAP/openui5/blob/2bba4ea6a49332575a87de443efdc6893d66b153/src/sap.m/test/sap/m/demokit/tutorial/worklist/06/webapp/test/testsuite.qunit.js

@codeworrior : we should also consider to update the walkthroughs with the latest declarative qunit testsuites.