Skip to content

Commit 1b837d6

Browse files
committed
chore(nodejs): improve test coverage
1 parent 8a7eeb2 commit 1b837d6

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/sender.test.js

+19
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,17 @@ describe('Sender connection suite', function () {
157157
await sender.close();
158158
await proxy.stop();
159159
});
160+
161+
it('can handle unfinished rows during flush()', async function () {
162+
const proxy = await createProxy(true, proxyOptions);
163+
const sender = await createSender(JWK, true);
164+
sender.table("test").symbol("location", "us");
165+
const sent = await sender.flush();
166+
expect(sent).toBe(false);
167+
await sender.close();
168+
await assertSentData(proxy, true, "testapp\n");
169+
await proxy.stop();
170+
});
160171
});
161172

162173
describe('Client interop test suite', function () {
@@ -367,6 +378,14 @@ describe('Sender message builder test suite (anything not covered in client inte
367378
).toThrow("Value must be an integer, received 123.222");
368379
});
369380

381+
it('throws exception if a float is passed as timestamp field', function () {
382+
const sender = new Sender({bufferSize: 1024});
383+
expect(
384+
() => sender.table("tableName")
385+
.timestampColumn("intField", 123.222)
386+
).toThrow("Value must be an integer, received 123.222");
387+
});
388+
370389
it('throws exception if designated timestamp is not a string', function () {
371390
const sender = new Sender({bufferSize: 1024});
372391
expect(

0 commit comments

Comments
 (0)