Skip to content

Commit d96254b

Browse files
committed
Fix flags tests and tweak RN docs
1 parent b319219 commit d96254b

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

packages/browser-sdk/test/flagCache.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export function newCache(): {
3535
cacheItem[0] = value;
3636
},
3737
},
38-
storageKey: "flags-cache",
3938
staleTimeMs: TEST_STALE_MS,
4039
expireTimeMs: TEST_EXPIRE_MS,
4140
}),

packages/browser-sdk/test/flags.test.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { FLAGS_EXPIRE_MS } from "../src/config";
55
import { FlagsClient, RawFlag } from "../src/flag/flags";
66
import { HttpClient } from "../src/httpClient";
77

8-
import { flagsResult } from "./mocks/handlers";
8+
import { flagResponse, flagsResult } from "./mocks/handlers";
99
import { newCache, TEST_STALE_MS } from "./flagCache.test";
1010
import { testLogger } from "./testLogger";
1111

@@ -26,6 +26,12 @@ function flagsClientFactory() {
2626

2727
vi.spyOn(httpClient, "get");
2828
vi.spyOn(httpClient, "post");
29+
vi.spyOn(globalThis, "fetch").mockResolvedValue(
30+
new Response(JSON.stringify(flagResponse), {
31+
status: 200,
32+
headers: { "Content-Type": "application/json" },
33+
}),
34+
);
2935

3036
return {
3137
cache,

packages/react-sdk/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ An Expo example app lives at `packages/react-sdk/dev/expo`.
163163
AsyncStorage is automatically detected in React Native if you have
164164
`@react-native-async-storage/async-storage` installed.
165165

166-
Since the toolbar is not available in React Native, you can set local overrides
167-
programmatically:
166+
If you have your own toolbar-like UI in React Native, you can set local
167+
overrides programmatically:
168168

169169
```tsx
170170
const client = useClient();

0 commit comments

Comments
 (0)