Skip to content

Commit 7a07942

Browse files
try to specify mock
Signed-off-by: Thomas Poignant <[email protected]>
1 parent cdde2b2 commit 7a07942

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,9 +1093,15 @@ describe('GoFeatureFlagProvider', () => {
10931093
});
10941094

10951095
it('Should not apply a scheduled rollout in the future', async () => {
1096-
fetchMock.mockResponseOnce(getConfigurationEndpointResult('scheduled-rollout'), {
1097-
status: 200,
1098-
headers: { 'Content-Type': 'application/json' },
1096+
jest.setSystemTime(new Date('2021-01-01T00:00:00Z'));
1097+
fetchMock.mockIf(/^http:\/\/localhost:1031\/v1\/flag\/configuration/, async () => {
1098+
return {
1099+
body: getConfigurationEndpointResult('scheduled-rollout'),
1100+
status: 200,
1101+
headers: {
1102+
'Content-Type': 'application/json',
1103+
},
1104+
};
10991105
});
11001106

11011107
const provider = new GoFeatureFlagProvider({

libs/providers/go-feature-flag/src/lib/service/api.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,6 @@ export class GoFeatureFlagApi {
214214
const goffResp = JSON.parse(body) as FlagConfigResponse;
215215
result.evaluationContextEnrichment = goffResp.evaluationContextEnrichment || {};
216216
result.flags = goffResp.flags || {};
217-
console.log('result.flags', result.flags);
218217
} catch (error) {
219218
this.logger?.warn(`Failed to parse flag configuration response: ${error}. Response body: "${body}"`);
220219
// Return the default result with empty flags and enrichment

0 commit comments

Comments
 (0)