fixed oracle export + clickhouse test

This commit is contained in:
Jan Prochazka
2024-12-20 12:23:29 +01:00
parent 62c028fc3c
commit b07ee91cf9
3 changed files with 6 additions and 9 deletions

View File

@@ -26,9 +26,9 @@ function createImportStream() {
function createExportStream() {
const writable = new stream.Writable({ objectMode: true });
writable.result = [];
writable.resultArray = [];
writable._write = (chunk, encoding, callback) => {
writable.result.push(chunk);
writable.resultArray.push(chunk);
callback();
};
return writable;
@@ -116,7 +116,7 @@ describe('DB Import/export', () => {
testWrapper(async (conn, driver, engine) => {
// const reader = await fakeObjectReader({ delay: 10 });
// const reader = await fakeObjectReader();
await runCommandOnDriver(conn, driver, 'create table ~t1 (~id int, ~country varchar(100))');
await runCommandOnDriver(conn, driver, 'create table ~t1 (~id int primary key, ~country varchar(100))');
const data = [
[1, 'Czechia'],
[2, 'Austria'],
@@ -138,7 +138,7 @@ describe('DB Import/export', () => {
const writer = createExportStream();
await copyStream(reader, writer);
expect(writer.result.filter(x => !x.__isStreamHeader).map(row => [row.id, row.country])).toEqual(data);
expect(writer.resultArray.filter(x => !x.__isStreamHeader).map(row => [row.id, row.country])).toEqual(data);
})
);
});