Skip to content

Commit 2e37b05

Browse files
adding mock for config
Signed-off-by: Thomas Poignant <[email protected]>
1 parent 3cc2b65 commit 2e37b05

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

libs/providers/go-feature-flag/src/lib/go-feature-flag-provider.test.ts

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,6 +1190,16 @@ describe('GoFeatureFlagProvider', () => {
11901190
it('should track events without context', async () => {
11911191
jest.setSystemTime(new Date('2021-01-01T00:00:00Z'));
11921192
fetchMock.mockIf(/^http:\/\/localhost:1031\/v1\/data\/collector/, async () => {
1193+
return {
1194+
body: getConfigurationEndpointResult(),
1195+
status: 200,
1196+
headers: {
1197+
'Content-Type': 'application/json',
1198+
},
1199+
};
1200+
});
1201+
1202+
fetchMock.mockIf(/^http:\/\/localhost:1031\/v1\/flag\/configuration/, async () => {
11931203
return {
11941204
body: JSON.stringify({}),
11951205
status: 200,
@@ -1245,6 +1255,17 @@ describe('GoFeatureFlagProvider', () => {
12451255
},
12461256
};
12471257
});
1258+
1259+
fetchMock.mockIf(/^http:\/\/localhost:1031\/v1\/flag\/configuration/, async () => {
1260+
return {
1261+
body: JSON.stringify({}),
1262+
status: 200,
1263+
headers: {
1264+
'Content-Type': 'application/json',
1265+
},
1266+
};
1267+
});
1268+
12481269
const provider = new GoFeatureFlagProvider({
12491270
endpoint: 'http://localhost:1031',
12501271
dataFlushInterval: 100,

0 commit comments

Comments
 (0)