Skip to content
Snippets Groups Projects
Commit cdc3a6e5 authored by OZGCloud's avatar OZGCloud
Browse files

OZG-5012 remove unused functions

parent 289d0c62
No related branches found
No related tags found
No related merge requests found
...@@ -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
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment