-
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.
test: add more tests and runtime checks
Throw error when ControllerExtension.use(...) is not called with one parameter.
- Loading branch information
Showing
7 changed files
with
92 additions
and
4 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
10 changes: 10 additions & 0 deletions
10
...ges/plugin/__test__/fixtures/typescript/ts-class-controller-extension-extended-error-1.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,10 @@ | ||
import Controller from "sap/ui/core/mvc/Controller"; | ||
import ControllerExtension from "sap/ui/core/mvc/ControllerExtension"; | ||
import Routing from "sap/fe/core/controllerextensions/Routing"; | ||
|
||
/** | ||
* @namespace test.controller | ||
*/ | ||
export default class MyExtendedController extends Controller { | ||
routing = ControllerExtension.use(); // should throw an error | ||
} |
10 changes: 10 additions & 0 deletions
10
...ges/plugin/__test__/fixtures/typescript/ts-class-controller-extension-extended-error-2.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,10 @@ | ||
import Controller from "sap/ui/core/mvc/Controller"; | ||
import ControllerExtension from "sap/ui/core/mvc/ControllerExtension"; | ||
import Routing from "sap/fe/core/controllerextensions/Routing"; | ||
|
||
/** | ||
* @namespace test.controller | ||
*/ | ||
export default class MyExtendedController extends Controller { | ||
routing = ControllerExtension.use(1, 2); // should throw an error | ||
} |
17 changes: 17 additions & 0 deletions
17
...ges/plugin/__test__/fixtures/typescript/ts-class-controller-extension-extended-renamed.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 CtrlEx from "sap/ui/core/mvc/ControllerExtension"; | ||
import Routing from "sap/fe/core/controllerextensions/Routing"; | ||
|
||
/** | ||
* @namespace test.controller | ||
*/ | ||
export default class MyExtendedController extends Controller { | ||
routing = /* comment */ CtrlEx.use( | ||
/* comment */ | ||
Routing.override( | ||
/* comment */ | ||
{ | ||
/* comment */ | ||
} | ||
)); | ||
} |
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
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
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