Skip to content

Commit

Permalink
Add tests to query stream
Browse files Browse the repository at this point in the history
  • Loading branch information
nofarham authored Jan 22, 2024
1 parent b263402 commit 97f1507
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/integration/connection/test-stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const assert = require('assert');
let rows;
const rows1 = [];
const rows2 = [];
const rows3 = [];

connection.query(
[
Expand Down Expand Up @@ -62,8 +63,14 @@ connection.execute('SELECT * FROM announcements', (err, _rows) => {
});
});

const s3 = connection.query('SELECT * FROM announcements').stream();
for await (const row of s3) {
rows3.push(row);
}

process.on('exit', () => {
assert.deepEqual(rows.length, 2);
assert.deepEqual(rows, rows1);
assert.deepEqual(rows, rows2);
assert.deepEqual(rows, rows3);
});

0 comments on commit 97f1507

Please sign in to comment.