Skip to content

Commit b89c301

Browse files
Adam Simonadams85
authored andcommitted
Correct failing test case
Signed-off-by: Adam Simon <[email protected]>
1 parent ec2223f commit b89c301

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

libs/providers/config-cat-web/src/lib/config-cat-web-provider.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,9 @@ describe('ConfigCatWebProvider', () => {
172172
expect(() => provider.resolveObjectEvaluation('jsonInvalid', {}, { targetingKey })).toThrow(ParseError);
173173
});
174174

175-
it('should throw TypeMismatchError if string is only a JSON primitive', () => {
176-
expect(() => provider.resolveObjectEvaluation('jsonPrimitive', {}, { targetingKey })).toThrow(TypeMismatchError);
175+
it('should return right value if key exists and value is only a JSON primitive', () => {
176+
const value = provider.resolveObjectEvaluation('jsonPrimitive', {}, { targetingKey });
177+
expect(value).toHaveProperty('value', JSON.parse(values.jsonPrimitive));
177178
});
178179
});
179180
});

libs/providers/config-cat/src/lib/config-cat-provider.spec.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,9 @@ describe('ConfigCatProvider', () => {
183183
await expect(provider.resolveObjectEvaluation('jsonInvalid', {}, { targetingKey })).rejects.toThrow(ParseError);
184184
});
185185

186-
it('should throw TypeMismatchError if string is only a JSON primitive', async () => {
187-
await expect(provider.resolveObjectEvaluation('jsonPrimitive', {}, { targetingKey })).rejects.toThrow(
188-
TypeMismatchError,
189-
);
186+
it('should return right value if key exists and value is only a JSON primitive', async () => {
187+
const value = await provider.resolveObjectEvaluation('jsonPrimitive', {}, { targetingKey });
188+
expect(value).toHaveProperty('value', JSON.parse(values.jsonPrimitive));
190189
});
191190
});
192191
});

0 commit comments

Comments
 (0)