fix: parse res to int in tests

This commit is contained in:
Nybkox
2025-04-08 09:34:56 +02:00
parent edece02c13
commit d1a6be6ca6

View File

@@ -133,14 +133,16 @@ describe('DB Import/export', () => {
for (const check of engine.dumpChecks || []) {
const res = await driver.query(conn, check.sql);
const cnt = parseInt(res.rows[0].res.toString());
expect(cnt).toEqual(check.res);
expect(cnt).toEqual(parseInt(check.res));
}
// const res1 = await driver.query(conn, `select count(*) as cnt from t1`);
// expect(res1.rows[0].cnt.toString()).toEqual('6');
const res1 = await driver.query(conn, `select count(*) as cnt from t1`);
const cnt1 = parseInt(res1.rows[0].cnt.toString());
expect(cnt1).toEqual(6);
// const res2 = await driver.query(conn, `select count(*) as cnt from t2`);
// expect(res2.rows[0].cnt.toString()).toEqual('6');
const res2 = await driver.query(conn, `select count(*) as cnt from t2`);
const cnt2 = parseInt(res2.rows[0].cnt.toString());
expect(cnt2).toEqual(6);
})
);
}