function templateRequire(sTag, sPrefix, mRequiredModules, that) {
		sPrefix ||= `template`;
		const sSuffix = sTag.endsWith(`/>`) ? `/>` : `>`;
		sTag = sTag.slice(0, -sSuffix.length)
			+ ` xmlns="sap.ui.core" xmlns:mvc="sap.ui.core.mvc"`
			+ ` xmlns:${sPrefix}="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"`;

		if (mRequiredModules) {
			const mAlias2Path = {};
			for (const sAlias in mRequiredModules) {
				mAlias2Path[sAlias] = typeof mRequiredModules[sAlias] === `string`
				? mRequiredModules[sAlias]
				: `foo/` + sAlias;
			}
			that.expectRequire(true, Object.values(mAlias2Path), function () {
				return Object.values(mRequiredModules);
			});
			sTag += ` ${sPrefix}:require="${JSON.stringify(mAlias2Path).replaceAll(`"`, `'`)}"`;
		}
		return sTag + sSuffix;
	}
Decorates the given tag with namespace definitions and requires modules. Takes care of self
closing tags.

@param {string} sTag
  some XML tag
@param {string} [sPrefix="template"]
  the prefix for the template namespace
@param {Object<string,object>} [mRequiredModules]
  map from alias to module content which should be required
@param {object} [that]
  the test context
@returns {string}
  <mvc:View> tag