How to change the base url from https://sdk.openui5.org to my local project?

38 Views Asked by At

I am a UI5-beginner and currently trying out unit testing.

testsuite.qunit.js

QUnit.config.autostart = false;

sap.ui.getCore().attachInit(() => {
    "use strict";
    debugger;
    sap.ui.require(["test/model/formatter"], () => {
        QUnit.start();
    });
});

testsuite.qunit.html

<!DOCTYPE html>
    <html>
        <head>
            <meta charset="utf-8">
            <title>KF test</title>
            <script id="sap-ui-bootstrap"
                src="http://sdk.openui5.org/resources/sap-ui-core.js"
                data-sap-ui-resourceroots='{
                    "xy.kfunittest": "../../"
                }'></script>
            <link rel="stylesheet" type="text/css" href="https://sdk.openui5.org/resources/sap/ui/thirdparty/qunit-2.css">

            <script src="https://sdk.openui5.org/resources/sap/ui/thirdparty/qunit-2.js"></script>
            <script src="https://sdk.openui5.org/resources/sap/ui/qunit/qunit-junit.js"></script>
            <script src="https://sdk.openui5.org/resources/sap/ui/qunit/qunit-coverage.js"></script>
            <script src="https://sdk.openui5.org/resources/sap/ui/thirdparty/sinon.js"></script>
            <script src="https://sdk.openui5.org/resources/sap/ui/thirdparty/sinon-qunit.js"></script>

            <script src="test/testsuite.qunit.js"></script>
        </head>
        <body>
            <div id="qunit"></div>
            <div id="qunit-fixture"></div>
        </body>
    </html>

testsuite.qunit.js should use the formatter from my UI5 project's webapp/test/model/ folder. I see in Chrome Debugger that it tryes to use the formatter from http://sdk.openui5.org. What can I do?

The error message:

Uncaught (in promise) ModuleError: failed to load 'test/model/formatter.js' from http://sdk.openui5.org/resources/test/model/formatter.js:
0

There are 0 best solutions below