diff --git a/test/integration/testExecute.js b/test/integration/testExecute.js index 4d7ca4840..fdf618bfa 100644 --- a/test/integration/testExecute.js +++ b/test/integration/testExecute.js @@ -455,19 +455,20 @@ describe('Execute test - variant', function () { it('Do not INSERT twice when the same request id and connection', async () => { let requestId; - await testUtil.executeCmdAsyncWithMoreParameters(firstConnection, 'INSERT INTO test_request_id VALUES (\'testValue\');') + await testUtil.executeCmdAsyncWithAdditionalParameters(firstConnection, 'INSERT INTO test_request_id VALUES (\'testValue\');') + await testUtil.executeCmdAsyncWithAdditionalParameters(firstConnection, 'INSERT INTO test_request_id VALUES (\'testValue\');') .then((result) => { requestId = result.rowStatement.getRequestId(); }); - await testUtil.executeCmdAsyncWithMoreParameters(firstConnection, + await testUtil.executeCmdAsyncWithAdditionalParameters(firstConnection, 'INSERT INTO test_request_id VALUES (\'testValue\');', { requestId: requestId }) .then((result) => { assert.strictEqual(result.rowStatement.getRequestId(), requestId); }); - await testUtil.executeCmdAsyncWithMoreParameters(firstConnection, 'SELECT * from test_request_id ;') + await testUtil.executeCmdAsyncWithAdditionalParameters(firstConnection, 'SELECT * from test_request_id ;') .then((result) => { assert.strictEqual(result.rows.length, 1); }); @@ -475,17 +476,17 @@ describe('Execute test - variant', function () { it('Execute INSERT for the same request id and different connection', async () => { let requestId; - await testUtil.executeCmdAsyncWithMoreParameters(firstConnection, 'INSERT INTO test_request_id VALUES (\'testValue\');') + await testUtil.executeCmdAsyncWithAdditionalParameters(firstConnection, 'INSERT INTO test_request_id VALUES (\'testValue\');') .then((result) => { requestId = result.rowStatement.getRequestId(); }); - await testUtil.executeCmdAsyncWithMoreParameters(secondConnection, 'INSERT INTO test_request_id VALUES (\'testValue\');', { requestId: requestId }) + await testUtil.executeCmdAsyncWithAdditionalParameters(secondConnection, 'INSERT INTO test_request_id VALUES (\'testValue\');', { requestId: requestId }) .then((result) => { assert.strictEqual(result.rowStatement.getRequestId(), requestId); }); - await testUtil.executeCmdAsyncWithMoreParameters(firstConnection, 'SELECT * from test_request_id ;') + await testUtil.executeCmdAsyncWithAdditionalParameters(firstConnection, 'SELECT * from test_request_id ;') .then((result) => { assert.strictEqual(result.rows.length, 2); }); @@ -493,20 +494,20 @@ describe('Execute test - variant', function () { it('Execute SELECT for the same request id and different data', async () => { let requestId; - await testUtil.executeCmdAsyncWithMoreParameters(firstConnection, 'INSERT INTO test_request_id VALUES (\'testValue\');'); - await testUtil.executeCmdAsyncWithMoreParameters(firstConnection, 'SELECT * from test_request_id;') + await testUtil.executeCmdAsyncWithAdditionalParameters(firstConnection, 'INSERT INTO test_request_id VALUES (\'testValue\');'); + await testUtil.executeCmdAsyncWithAdditionalParameters(firstConnection, 'SELECT * from test_request_id;') .then((result) => { assert.strictEqual(result.rows.length, 1); requestId = result.rowStatement.getRequestId(); }); - await testUtil.executeCmdAsyncWithMoreParameters(firstConnection, 'INSERT INTO test_request_id VALUES (\'testValue\');'); - await testUtil.executeCmdAsyncWithMoreParameters(firstConnection, 'SELECT * from test_request_id;', { requestId: requestId }) + await testUtil.executeCmdAsyncWithAdditionalParameters(firstConnection, 'INSERT INTO test_request_id VALUES (\'testValue\');'); + await testUtil.executeCmdAsyncWithAdditionalParameters(firstConnection, 'SELECT * from test_request_id;', { requestId: requestId }) .then((result) => { assert.strictEqual(result.rows.length, 1); }); - await testUtil.executeCmdAsyncWithMoreParameters(firstConnection, 'SELECT * from test_request_id ;') + await testUtil.executeCmdAsyncWithAdditionalParameters(firstConnection, 'SELECT * from test_request_id ;') .then((result) => { assert.strictEqual(result.rows.length, 2); }); diff --git a/test/integration/testUtil.js b/test/integration/testUtil.js index 2d83b5d55..c15b61449 100644 --- a/test/integration/testUtil.js +++ b/test/integration/testUtil.js @@ -96,18 +96,18 @@ const executeCmdAsync = function (connection, sqlText, binds = undefined) { module.exports.executeCmdAsync = executeCmdAsync; -const executeCmdAsyncWithMoreParameters = function (connection, sqlText, moreParameters) { +const executeCmdAsyncWithAdditionalParameters = function (connection, sqlText, additionalParameters) { return new Promise((resolve, reject) => { const executeParams = { ...{ sqlText: sqlText, complete: (err, rowStatement, rows) => err ? reject(err) : resolve({ rowStatement: rowStatement, rows: rows }) - }, ...moreParameters }; + }, ...additionalParameters }; connection.execute(executeParams); }); }; -module.exports.executeCmdAsyncWithMoreParameters = executeCmdAsyncWithMoreParameters; +module.exports.executeCmdAsyncWithAdditionalParameters = executeCmdAsyncWithAdditionalParameters; /** * Drop tables one by one if exist - any connection error is ignored * @param connection Connection