Skip to content

Commit

Permalink
[FEATURE] Add support for UI5 2.x in "script" mode
Browse files Browse the repository at this point in the history
JIRA: CPOUI5FOUNDATION-937
  • Loading branch information
matz3 committed Nov 8, 2024
1 parent 3094705 commit e7ce5c8
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion lib/client/autorun.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,21 @@
// Prevent Karma from running prematurely.
karma.loaded = function() { };

sap.ui.getCore().attachInit(function() {
function requireTestsAndStartKarma() {
sap.ui.require(ui5configTests, function() {
// Finally, start Karma to run the tests.
karma.start();
});
}

sap.ui.require(["sap/ui/core/Core"], function(Core) {
if (typeof Core.ready === "function") {
// Available since 1.118
Core.ready(requireTestsAndStartKarma);
} else {
// Deprecated as of 1.118 and removed in 2.x
// Still relevant for older versions such as 1.71
Core.attachInit(requireTestsAndStartKarma);
}
});
})(window);

0 comments on commit e7ce5c8

Please sign in to comment.