diff --git a/integration-tests/__tests__/object-analyse.spec.js b/integration-tests/__tests__/object-analyse.spec.js index c59b0e259..a24462fe8 100644 --- a/integration-tests/__tests__/object-analyse.spec.js +++ b/integration-tests/__tests__/object-analyse.spec.js @@ -7,7 +7,7 @@ const initSql = ['CREATE TABLE t1 (id int)', 'CREATE TABLE t2 (id int)']; function flatSource() { return _.flatten( - engines.map(engine => (engine.objects || []).map(object => [engine.label, engine, object.type, object])) + engines.map(engine => (engine.objects || []).map(object => [engine.label, object.type, object, engine])) ); } @@ -18,7 +18,7 @@ const obj1Match = expect.objectContaining({ describe('Object analyse', () => { test.each(flatSource())( 'Full analysis (%s - %s)', - testWrapper(async (conn, driver, engine, type, object) => { + testWrapper(async (conn, driver, type, object, engine) => { for (const sql of initSql) await driver.query(conn, sql); await driver.query(conn, object.create1); @@ -31,7 +31,7 @@ describe('Object analyse', () => { test.each(flatSource())( 'Incremental analysis - add (%s - %s)', - testWrapper(async (conn, driver, engine, type, object) => { + testWrapper(async (conn, driver, type, object, engine) => { for (const sql of initSql) await driver.query(conn, sql); await driver.query(conn, object.create2); @@ -46,7 +46,7 @@ describe('Object analyse', () => { test.each(flatSource())( 'Incremental analysis - drop (%s - %s)', - testWrapper(async (conn, driver, engine, type, object) => { + testWrapper(async (conn, driver, type, object, engine) => { for (const sql of initSql) await driver.query(conn, sql); await driver.query(conn, object.create1); diff --git a/integration-tests/tools.js b/integration-tests/tools.js index 29593adbb..821ea7eb8 100644 --- a/integration-tests/tools.js +++ b/integration-tests/tools.js @@ -44,11 +44,12 @@ async function connect(engine, database) { } } -const testWrapper = body => async (label, engine, ...other) => { +const testWrapper = body => async (label, ...other) => { + const engine = other[other.length - 1]; const driver = requireEngineDriver(engine.connection); const conn = await connect(engine, randomDbName()); try { - await body(conn, driver, engine, ...other); + await body(conn, driver, ...other); } finally { await driver.close(conn); }