-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: support wrapped controller extension assignments
Code instrumentation (for coverage measurement) may wrap controller extension assignments like: this.routing = (cov_1uvvg22e7l().s[5]++, ControllerExtension.use(Routing.override({ … })));
- Loading branch information
Showing
3 changed files
with
82 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
packages/plugin/__test__/fixtures/typescript/ts-class-controller-extension-wrapped.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import Controller from "sap/ui/core/mvc/Controller"; | ||
import ControllerExtension from "sap/ui/core/mvc/ControllerExtension"; | ||
import Routing from "sap/fe/core/controllerextensions/Routing"; | ||
|
||
const cov_1uvvg22e7l = () => { return { "s": {} }; }; // dummy coverage function | ||
|
||
/** | ||
* @namespace test.controller | ||
*/ | ||
export default class MyExtendedController extends Controller { | ||
|
||
// code could already be instrumented, e.g. for code coverage by istanbul, and look like this: | ||
//this.routing = (cov_1uvvg22e7l().s[5]++, ControllerExtension.use(Routing.override({ … }))); | ||
routing = (cov_1uvvg22e7l().s[5]++, ControllerExtension.use(Routing)); | ||
routing2 = (cov_1uvvg22e7l().s[5]++, ControllerExtension.use(Routing.override({}))); | ||
routing3 = (cov_1uvvg22e7l().s[5]++, cov_1uvvg22e7l().s[5]++, ControllerExtension.use(Routing.override({}))); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters