Skip to content

Commit 7e8375f

Browse files
committed
chore(flagsmith): moved-cache-key-to-mocks
Signed-off-by: wadii <[email protected]>
1 parent c1fbfea commit 7e8375f

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

libs/providers/flagsmith-client/src/lib/flagsmith-client-provider.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import {
1111
exampleNumericFlagName,
1212
exampleStringFlagName,
1313
getFetchErrorMock,
14+
CACHE_KEY,
1415
} from './flagsmith.mocks';
1516
import { OpenFeature, ProviderEvents } from '@openfeature/web-sdk';
1617
import { createFlagsmithInstance } from 'flagsmith';
@@ -23,8 +24,6 @@ const logger = {
2324
warn: jest.fn(),
2425
};
2526

26-
const CACHE_KEY = 'FLAGSMITH_CACHE_DB';
27-
2827
describe('FlagsmithProvider', () => {
2928
beforeEach(async () => {
3029
// Clear all instances and calls to constructor and all methods of mock logger

libs/providers/flagsmith-client/src/lib/flagsmith.mocks.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,12 @@ export const defaultState = {
156156
environmentID: environmentID,
157157
};
158158

159+
export const CACHE_KEY = 'FLAGSMITH_CACHE_DB';
160+
159161
export const cacheConfig = {
160162
cacheFlags: true,
161163
cacheOptions: {
162164
ttl: 1000,
163-
storageKey: 'FLAGSMITH_CACHE_DB',
165+
storageKey: CACHE_KEY,
164166
},
165167
};

0 commit comments

Comments
 (0)