Skip to content

Commit c1025a0

Browse files
Update libs/providers/flagd/src/e2e/step-definitions/providerSteps.ts
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Marco Zabel <[email protected]>
1 parent 8a5a75a commit c1025a0

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

libs/providers/flagd/src/e2e/step-definitions/providerSteps.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,14 @@ export const providerSteps: Steps =
6969
});
7070

7171
function mapProviderState(state: string): ProviderStatus {
72-
const key = state.toUpperCase().replace('-', '_') as keyof typeof ProviderStatus;
72+
const mappedState = state.toUpperCase().replace('-', '_');
73+
const status = Object.values(ProviderStatus).find((s) => s === mappedState);
7374

74-
if (!(key in ProviderStatus)) {
75-
throw new Error('Unknown provider status');
75+
if (!status) {
76+
throw new Error(`Unknown provider status: ${state}`);
7677
}
7778

78-
return ProviderStatus[key];
79+
return status;
7980
}
8081

8182
then(/^the client should be in (.*) state/, (providerState: string) => {

0 commit comments

Comments
 (0)