Skip to content

Commit

Permalink
test(exporter-collector): add test for converting number to int and d…
Browse files Browse the repository at this point in the history
…ouble
  • Loading branch information
kudlatyamroth committed Feb 17, 2021
1 parent 96c6f79 commit bc9d827
Showing 1 changed file with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,21 @@ describe('transform', () => {
]);
});

it('should convert attribute integer', () => {
it('should convert attribute integer to integer', () => {
const attributes: SpanAttributes = {
foo: 13,
};
assert.deepStrictEqual(transform.toCollectorAttributes(attributes), [
{ key: 'foo', value: { doubleValue: 13 } },
{ key: 'foo', value: { intValue: 13 } },
]);
});

it('should convert attribute integer to double', () => {
const attributes: SpanAttributes = {
foo: 2247483647,
};
assert.deepStrictEqual(transform.toCollectorAttributes(attributes), [
{ key: 'foo', value: { doubleValue: 2247483647 } },
]);
});

Expand Down Expand Up @@ -118,7 +127,7 @@ describe('transform', () => {
},
{
key: 'version',
value: { doubleValue: 1 },
value: { intValue: 1 },
},
{ key: 'success', value: { boolValue: true } },
],
Expand Down

0 comments on commit bc9d827

Please sign in to comment.