Skip to content

Commit

Permalink
chore: test point values
Browse files Browse the repository at this point in the history
  • Loading branch information
bednar committed Sep 18, 2023
1 parent 802ad9f commit 9d28e69
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions packages/client/test/unit/util/point.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,5 +238,28 @@ describe('point', () => {
v.removeField('b')
expect(false).equals(v.hasFields())
})
it('remove tag', () => {
const v = new PointValues()
.setMeasurement('a')
.setField('b', 1)
.setTag('c', 'd')
.setTimestamp(150)
expect(true).eq(v.getTagNames().includes('c'))
v.removeTag('c')
expect(false).eq(v.getTagNames().includes('c'))
})
it('field values', () => {
const v = new PointValues()
.setMeasurement('a')
.setIntegerField('b', 1)
.setField('c', 'xyz')
.setField('d', false)
.setField('e', 3.45)
.setTimestamp(150)
expect(1).deep.equals(v.getIntegerField('b'))
expect('xyz').deep.equals(v.getStringField('c'))
expect(false).deep.equals(v.getBooleanField('d'))
expect(3.45).deep.equals(v.getFloatField('e'))
})
})
})

0 comments on commit 9d28e69

Please sign in to comment.