Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow mockFlags to take an unmodified string #14

Closed
tylerwgrass opened this issue Nov 3, 2021 · 2 comments
Closed

Allow mockFlags to take an unmodified string #14

tylerwgrass opened this issue Nov 3, 2021 · 2 comments

Comments

@tylerwgrass
Copy link

Problem

When passing a string to mockFlags, it converts the string using lodash.kebabcase and lodash.camelcase, but does not also store the original string:
https://github.com/launchdarkly-labs/jest-launchdarkly-mock/blob/4a9f50510c6057f43a54cb1677f99f1b0fe402bf/src/index.ts#L44-L53

This causes issues where if the flag is not a "valid" kebab-case string or camelCase string, it is not included in the flags set. For example, the flag Client-MyCoolFlag gets converted to client-my-cool-flag and clientMyCoolFlag, neither of which are the original flag.

Recommendation

Also store the original string in the flags set to allow flags that don't conform exactly to camel or kebab casing to be mocked properly.

@jermspeaks
Copy link

jermspeaks commented Nov 10, 2021

Reviewing a similar issue, it would appear #7 solves this issue.

@bwoskow-ld any way we could expedite this?

@yusinto
Copy link
Collaborator

yusinto commented Feb 3, 2022

#7 has been merged and will be released shortly. Apologies for the long wait.

@yusinto yusinto closed this as completed Feb 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants