refactor application.yaml to become an os definition #40
This commit is contained in:
15
tests/unit/stubs/EnumParserStub.ts
Normal file
15
tests/unit/stubs/EnumParserStub.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import { IEnumParser } from '@/application/Common/Enum';
|
||||
|
||||
export function mockEnumParser<T>(inputName: string, inputValue: string, outputValue: T): IEnumParser<T> {
|
||||
return {
|
||||
parseEnum: (value, name) => {
|
||||
if (name !== inputName) {
|
||||
throw new Error(`Unexpected name: "${name}"`);
|
||||
}
|
||||
if (value !== inputValue) {
|
||||
throw new Error(`Unexpected value: "${value}"`);
|
||||
}
|
||||
return outputValue;
|
||||
},
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user