Skip to content

Commit 8f6c70b

Browse files
committed
update
1 parent 123524e commit 8f6c70b

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

lib/utils/attributes_validator/index.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ describe('validate', () => {
7474
attributesValidator.validate(attributes);
7575
} catch(err) {
7676
expect(err).toBeInstanceOf(OptimizelyError);
77-
expect(err.baseMessage).toBe(UNDEFINED_ATTRIBUTE);
77+
expect(err.baseMessage).toBe(UNDEFINED_ATTRIBUTE);
78+
expect(err.params).toEqual([attributeKey]);
7879
}
7980
});
8081
});

lib/utils/config_validator/index.spec.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ describe('validate', () => {
5555
} catch(err) {
5656
expect(err).toBeInstanceOf(OptimizelyError);
5757
expect(err.baseMessage).toBe(INVALID_DATAFILE_VERSION);
58+
expect(err.params).toEqual(['5']);
5859
}
5960
});
6061

lib/utils/event_tag_utils/index.spec.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,13 @@ describe('getEventValue', () => {
6464
});
6565

6666
it('should return the parsed integer for a valid numeric value', () => {
67-
const parsedNumericValue = eventTagUtils.getEventValue({ value: '1337' }, logger);
67+
let parsedEventValue = eventTagUtils.getEventValue({ value: '1337' }, logger);
6868

69-
expect(parsedNumericValue).toBe(1337);
69+
expect(parsedEventValue).toBe(1337);
7070
expect(logger.info).toHaveBeenCalledWith(PARSED_NUMERIC_VALUE, 1337);
71+
72+
parsedEventValue = eventTagUtils.getEventValue({ value: '13.37' }, logger);
73+
expect(parsedEventValue).toBe(13.37);
7174
});
7275

7376
it('should return null and log a message for invalid value', () => {

0 commit comments

Comments
 (0)