Skip to Content

Question with qUnit setup in SAPUI5 application

I'm trying to implement unit testing within my SAPUI5 Application. I understand how to perform the unit tests --but I'm having difficulty in the initial setup in my SAP UI5 application. I believe the problem is how I'm attempting to load in the controller I want to test. I have a basic tree structure like so:

At this point, the next step would be setup the test.js. In that file, I need to reference the controller I'd like to test against. I figured I would need to load in the controller as a dependency, but I'm not following how to do so correctly. Below are my files test.js & initialTest.html. Can someone point me in the right direction in terms of setup?


     //Quint code
     test("hello test", function(assert) {
      assert.ok(1 == "1", "Passed!");
   <!DOCTYPE html>
      <meta charset="utf-8">
      <title>QUnit Example</title>
      <link rel="stylesheet" href="//">
          <script id="sap-ui-bootstrap"
          <script src="//"></script>
          <script src="tests.js"></script>
          <script src="/Controller/Main.controller.js"></script>          
      <div id="qunit"></div>
      <div id="qunit-fixture"></div>
filestructure.png (25.0 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers