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

Mock with useCamelCaseFlagKeys = false #6

Closed
tboulis opened this issue Jun 9, 2021 · 2 comments
Closed

Mock with useCamelCaseFlagKeys = false #6

tboulis opened this issue Jun 9, 2021 · 2 comments

Comments

@tboulis
Copy link
Contributor

tboulis commented Jun 9, 2021

I've noticed in your code that you automatically convert the flags to kebab case and camelcase:

exports.mockFlags = function (flags) {
    mockUseFlags.mockImplementation(function () {
        var result = {};
        Object.keys(flags).forEach(function (k) {
            var kebab = lodash_kebabcase_1.default(k);
            var camel = lodash_camelcase_1.default(k);
            result[kebab] = flags[k];
            result[camel] = flags[k];
        });
        return result;
    });
};

We use flags with snake case. Is it possible to either configure this by passing a config object to mockFlags or by mocking the Provider that is returned from asyncWithLDProvider?

tboulis added a commit to tboulis/jest-launchdarkly-mock that referenced this issue Jun 9, 2021
yusinto added a commit that referenced this issue Feb 3, 2022
[issue-#6] Include flag as is (no case formatting)
@yusinto
Copy link
Collaborator

yusinto commented Feb 9, 2022

Hi @tboulis we have an upcoming release to support snake case so it's coming. I'll update this issue when the release is published. Thank you for your patience.

@yusinto
Copy link
Collaborator

yusinto commented Mar 23, 2022

This is now fixed in v1.0.0.

@yusinto yusinto closed this as completed Mar 23, 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

2 participants