diff --git a/internal/sdks/sdks.go b/internal/sdks/sdks.go index ea503743..289432c0 100644 --- a/internal/sdks/sdks.go +++ b/internal/sdks/sdks.go @@ -17,15 +17,6 @@ func ReplaceFlagKey(instructions string, key string) string { key, "myFlagKey", kebabToCamel(key), - // remove remaining keys when we add all hardcoded instructions - "my-flag", - key, - "my-boolean-flag", - key, - "FLAG_KEY", - key, - "", - key, ) return r.Replace(instructions) diff --git a/internal/sdks/sdks_test.go b/internal/sdks/sdks_test.go index 94a98725..1f3a9421 100644 --- a/internal/sdks/sdks_test.go +++ b/internal/sdks/sdks_test.go @@ -17,26 +17,14 @@ func TestReplaceFlagKey(t *testing.T) { body: "# title ```const featureFlagKey = \"my-flag-key\"```", expected: "# title ```const featureFlagKey = \"real-flag-key\"```", }, - "replaces placeholder my-flag": { - body: "# title ```const featureFlagKey = \"my-flag\"```", - expected: "# title ```const featureFlagKey = \"real-flag-key\"```", - }, - "replaces placeholder my-boolean-flag": { - body: "# title ```const featureFlagKey = \"my-boolean-flag\"```", - expected: "# title ```const featureFlagKey = \"real-flag-key\"```", - }, - "replaces placeholder FLAG_KEY": { - body: "# title ```const featureFlagKey = \"my-boolean-flag\"```", - expected: "# title ```const featureFlagKey = \"real-flag-key\"```", - }, - "replaces placeholder ": { - body: "# title ```hello_erlang_server:get(<<\"FLAG_KEY\">>)```", - expected: "# title ```hello_erlang_server:get(<<\"real-flag-key\">>)```", - }, "replaces camelCase ": { body: "# title ```const featureFlagKey = \"myFlagKey\"```", expected: "# title ```const featureFlagKey = \"realFlagKey\"```", }, + "does not replace BOOLEAN_FLAG_KEY": { + body: "# title ```val BOOLEAN_FLAG_KEY = \"myFlagKey\"```", + expected: "# title ```val BOOLEAN_FLAG_KEY = \"realFlagKey\"```", + }, } for name, tt := range tests { tt := tt