Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend-clients
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OZG-Cloud
app
frontend-clients
Commits
cdc3a6e5
Commit
cdc3a6e5
authored
1 year ago
by
OZGCloud
Browse files
Options
Downloads
Patches
Plain Diff
OZG-5012 remove unused functions
parent
289d0c62
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
alfa-client/libs/test-utils/src/lib/mocking.ts
+3
-20
3 additions, 20 deletions
alfa-client/libs/test-utils/src/lib/mocking.ts
with
3 additions
and
20 deletions
alfa-client/libs/test-utils/src/lib/mocking.ts
+
3
−
20
View file @
cdc3a6e5
...
@@ -21,8 +21,10 @@
...
@@ -21,8 +21,10 @@
* Die sprachspezifischen Genehmigungen und Beschränkungen
* Die sprachspezifischen Genehmigungen und Beschränkungen
* unter der Lizenz sind dem Lizenztext zu entnehmen.
* unter der Lizenz sind dem Lizenztext zu entnehmen.
*/
*/
import
{
Component
,
EventEmitter
,
Type
}
from
'
@angular/core
'
;
import
{
Type
}
from
'
@angular/core
'
;
// Cannot find namespace 'jest'.ts(2503)
// Exported type alias 'Mock' has or is using private name 'jest'
export
type
Mock
<
T
>
=
{
[
K
in
keyof
T
]:
jest
.
Mock
};
export
type
Mock
<
T
>
=
{
[
K
in
keyof
T
]:
jest
.
Mock
};
export
function
mock
<
T
>
(
service
:
Type
<
T
>
):
Mock
<
T
>
{
export
function
mock
<
T
>
(
service
:
Type
<
T
>
):
Mock
<
T
>
{
...
@@ -34,29 +36,10 @@ export function mock<T>(service: Type<T>): Mock<T> {
...
@@ -34,29 +36,10 @@ export function mock<T>(service: Type<T>): Mock<T> {
<
any
>
{},
<
any
>
{},
);
);
}
}
export
function
useFromMock
<
T
>
(
mockToUse
:
Mock
<
T
>
):
T
{
export
function
useFromMock
<
T
>
(
mockToUse
:
Mock
<
T
>
):
T
{
return
<
T
>
(
<
any
>
mockToUse
);
return
<
T
>
(
<
any
>
mockToUse
);
}
}
export
function
mockComponent
(
options
:
Component
):
Component
{
const
metadata
:
Component
=
{
selector
:
options
.
selector
,
template
:
options
.
template
||
''
,
inputs
:
options
.
inputs
,
outputs
:
options
.
outputs
||
[],
exportAs
:
options
.
exportAs
||
''
,
};
class
Mock
{}
metadata
.
outputs
.
forEach
((
method
)
=>
{
Mock
.
prototype
[
method
]
=
new
EventEmitter
<
any
>
();
});
return
Component
(
metadata
)(
Mock
as
any
);
}
export
function
mockClass
(
clazz
:
any
):
Mock
<
any
>
{
export
function
mockClass
(
clazz
:
any
):
Mock
<
any
>
{
return
clazz
as
jest
.
Mocked
<
typeof
clazz
>
;
//NOSONAR
return
clazz
as
jest
.
Mocked
<
typeof
clazz
>
;
//NOSONAR
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment