Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

QA Mode #10

Open
jdorn opened this issue Mar 15, 2021 · 0 comments
Open

QA Mode #10

jdorn opened this issue Mar 15, 2021 · 0 comments

Comments

@jdorn
Copy link
Member

jdorn commented Mar 15, 2021

Make it easier to test experiments during automated testing. Example below uses Jest, but these new helper methods and qa flag should be applicable to any testing library.

describe('my app', () => {
  beforeAll(() => {
    // Flag to turn on QA mode
    // Force variation -1 for all experiments unless explicitly forced to something else
    // Disable auto experiments
    client.config.qa = true;
  })
  beforeEach(() => {
    // Undo any forces applied within test cases
    client.forcedVariations.clear();
  })

  it("works for control", () => {
    // test the control behavior
  })

  it("works for variation", () => {
    // force a non-control variation
    client.forceVariations.set("my-test", 1);

    // test the variation 1 behavior
  })
})
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant