Skip to content
This repository was archived by the owner on Oct 18, 2024. It is now read-only.

fix: handle testing environment using defaults #26

Merged
merged 1 commit into from
Jul 13, 2024

Conversation

dan-mba
Copy link
Member

@dan-mba dan-mba commented Jul 13, 2024

Fixes Issue

Closes #22

Changes proposed

Use try/catch to ignore flagsmith init error & use defaults
Don't run playwright as pre-commit as errors are hidden when using git in IDE (VSCode)

Check List (Check all the applicable boxes)

  • My code follows the code style of this project.
  • My change requires changes to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • This PR does not contain plagiarized content.
  • The title of my pull request is a short description of the requested changes.

@@ -5,18 +5,22 @@ import config from "./flagsmith.json";
export default async function flagsmith() {
const defaults = Object.fromEntries(
config.map((flag) => [
[flag.name],
flag.name,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh good spot 💯

} catch {
// Handle unable to connect to Flagsmith or not having valid environment
// Defaults will be used
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh I see 😱

Copy link
Member

@eddiejaoude eddiejaoude left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@eddiejaoude eddiejaoude merged commit 1f2e969 into EddieHubCommunity:main Jul 13, 2024
2 checks passed
@dan-mba dan-mba deleted the local-test branch July 13, 2024 18:03
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Playwright tests fail as need default feature flags
2 participants