This repository was archived by the owner on Dec 7, 2022. It is now read-only.
Repository navigation
SELA-1352 - Allow Launch Darkly query parameter overrides #6
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5408ea5
de-ordinal test stubs, deduplicate testee jsx
sethbattin cc252e2
implement url checking, functional testing works but mocha fails
sethbattin 2acf536
move override logic into ld lib wrapper, and add a mock to the compon…
sethbattin baa62f9
add stubs for lib/launchDarkly tests, experiment with location mocking
sethbattin f2bd8c0
wrap window.location to permit test override
sethbattin 889ec8d
add simple test case and comma-list test case
sethbattin db47d4a
parse query parameter "features" in simple and list forms
sethbattin 5739db0
remove escaped quotes
sethbattin 1c46baa
Merge branch 'master' into story/SELA-1352
jacobmoretti f96b602
add test-specific eslintrc
sethbattin c3535ba
fix linting errors
sethbattin c117ac5
Merge branch 'master' into story/SELA-1352
jacobmoretti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| { | ||
| "env": { | ||
| "mocha": true | ||
| } | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| import { expect } from "chai"; | ||
| import { spy } from "sinon"; | ||
| import * as ldClient from "./../../src/lib/launchDarkly.js"; | ||
| import launchDarklyBrowser from "ldclient-js"; | ||
|
|
||
| describe("lib/launchDarkly", () => { | ||
| it("exports three functions", () => { | ||
| expect(ldClient).to.have.property("ldBrowserInit"); | ||
| expect(ldClient).to.have.property("ldOverrideFlag"); | ||
| expect(ldClient).to.have.property("getAllFeatureFlags"); | ||
| }); | ||
|
|
||
| describe("ldBroswerInit", () => { | ||
| it("proxies to ldclient-js", () => { | ||
| const key = "my key"; | ||
| const user = "my user"; | ||
| spy(launchDarklyBrowser, "initialize").withArgs(key, user); | ||
| ldClient.ldBrowserInit(key, user); | ||
|
|
||
| // this is misuse of sinon; the expectation fails | ||
| //expect(launchDarklyBrowser.initialize.withArgs(key, user).calledOnce).to.be.ok() | ||
|
|
||
| }); | ||
| }); | ||
| describe("getAllFeatureFlags", () => { | ||
|
|
||
| }); | ||
| describe("ldOverrideFlag", () => { | ||
|
|
||
| }); | ||
|
|
||
| }); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This works for supporting the advanced overriding, e.g.,
?features.flagA=truebut I'm not seeing support for the basic list of boolean flags, e.g.,?features=flagA,flagB,flagC.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right and I will fix that.