diff --git a/packages/client/test/unit/util/point.test.ts b/packages/client/test/unit/util/point.test.ts index c4e1b165..a6300b71 100644 --- a/packages/client/test/unit/util/point.test.ts +++ b/packages/client/test/unit/util/point.test.ts @@ -202,8 +202,10 @@ describe('point', () => { .setField('b', 1) .setTag('c', 'd') .setTimestamp(150) - const p = v.asPoint() + let p = v.asPoint() expect('a,c=d b=1 150').equals(p.toString()) + p = v.asPoint('x') + expect('x,c=d b=1 150').equals(p.toString()) }) it('convert point values to point with undefined measurement', () => { const v = new PointValues() @@ -255,11 +257,23 @@ describe('point', () => { .setField('c', 'xyz') .setField('d', false) .setField('e', 3.45) + .setUintegerField('f', 8) + .setStringField('g', 88) .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')) + expect(8).deep.equals(v.getUintegerField('f')) + expect('88').deep.equals(v.getStringField('g')) }) }) + it('undefined field', () => { + const v = new PointValues() + .setMeasurement('a') + .setField('c', 'xyz') + .setTimestamp(150) + expect(undefined).deep.equals(v.getField('x')) + expect(undefined).deep.equals(v.getFieldType('x')) + }) })