Skip to content

Improve developer experience for specs #161

@sdhull

Description

@sdhull

Description

When implementing a new feature I need to ensure my code works for every variation, but typically it's more important that I can verify the new variation works. But either way, just stubbing client.variation to return something doesn't exactly cut it because there could be many variations expecting a wide variety of return values.

Solution I'd like

First and foremost, simply add a "Testing" section to the Readme and/or official SDK docs.

If you wanted to help your customers even more, I think it would be nice to be able to specify something like this in my spec helper:

launch_darkly_client.variation_defaults = {
   "key" => true,
   "key2" => { something: :new },
}

(and these would override the default specified in ld_client.variation(key, user, default), because the default I pass in code is essentially "off" and the default I want in specs is typically "on"). Also I'm not sure about the method name, maybe it should be #variation_stubs or #override_variations or something like that.

But regardless of whether you implement that or not, simply adding a "Testing" section to the readme or documentation would go a long way to help the next person who wanders in wondering how the heck to wrangle LD in specs.

Alternatives considered

There is no alternative to good documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions