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

Commit

Permalink
fix: mswjs mocks for flagsmith
Browse files Browse the repository at this point in the history
  • Loading branch information
eddiejaoude committed Aug 31, 2024
1 parent ddf3d56 commit 5b1e5d0
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
1 change: 0 additions & 1 deletion src/instrumentation.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ export async function register() {
"localhost:3000",
"googleapis.com",
"gstatic.com",
"api.flagsmith.com",
"github.com/mona.png",
];

Expand Down
1 change: 1 addition & 0 deletions tests/data/flagsmith/flags.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[]
4 changes: 4 additions & 0 deletions tests/data/flagsmith/identities.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"traits": [],
"flags": []
}
11 changes: 11 additions & 0 deletions tests/setup/mocks/handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,19 @@ import labels from "../../data/github/labels.json";
import projects from "../../data/github/projects.json";
import referrers from "../../data/github/referrers.json";
import views from "../../data/github/views.json";
import identities from "../../data/flagsmith/identities.json";
import flags from "../../data/flagsmith/flags.json";

export const handlers = [
// flagsmith
http.post("https://edge.api.flagsmith.com/api/v1/identities/", () =>
HttpResponse.json(identities),
),
http.get("https://edge.api.flagsmith.com/api/v1/flags/", () =>
HttpResponse.json(flags),
),

// github
http.get("https://api.github.com/repos/EddieHubCommunity/HealthCheck", () =>
HttpResponse.json(repo),
),
Expand Down

0 comments on commit 5b1e5d0

Please sign in to comment.