Skip to Content
0
Feb 04, 2019 at 10:29 AM

unit test extended app

67 Views Last edit Feb 05, 2019 at 07:55 AM 2 rev

I want to use unit tests in an extended app.
If I wrote a unit test for some functions in an extended controller, I get the error that the BaseController which is used in the parent controller can not be loaded.

It looks like that there is namespace problem.

The extended controller is in the Namespace sap.xx.yyyyyyyy.zzzzzzz
The parent controller is in the Namespace sap.xx.yyyyyyyy

The AllTest.js ist defined like that.

sap.ui.define([
	"sap/xx/yyyyyyy/zzzzz/test/unit/controller/Trip.controller"
], function () {
	"use strict";
});

But the BaseController ist in that namespace

"sap/xx/yyyyyyy/controller/BaseController"

The bootstrap definition in the unitTests.qunit.html looks like that.

	<script id="sap-ui-bootstrap"
		src="../../../resources/sap-ui-core.js"
		data-sap-ui-resourceroots='{
			"sap.xx.yyyyyyy.zzzzz":  "../../"
		}'>
	</script>

Any idea to solve that namespace problem?

Thank you!