diff --git a/src/api/tests/suites/connection.test.ts b/src/api/tests/suites/connection.test.ts index 846d3256d..fd02966c8 100644 --- a/src/api/tests/suites/connection.test.ts +++ b/src/api/tests/suites/connection.test.ts @@ -4,6 +4,7 @@ import { Tools } from '../../Tools'; import { CONNECTION_TIMEOUT, disposeConnection, newConnection } from '../connection'; import IBMi from '../../IBMi'; import { getJavaHome } from '../../configuration/DebugConfiguration'; +import { CompileTools } from '../../CompileTools'; describe(`connection tests`, {concurrent: true}, () => { let connection: IBMi @@ -218,6 +219,25 @@ describe(`connection tests`, {concurrent: true}, () => { expect(qtempIndex < qsysincIndex).toBeTruthy(); }); + it('runCommand (ILE, variable expansion)', async () => { const config = connection.getConfig(); + + const result = await CompileTools.runCommand(connection, + { + command: `CRTDTAARA DTAARA(&SCOOBY/TEST) TYPE(*CHAR) LEN(10)`, + environment: `ile`, + env: {'&SCOOBY': `QTEMP`}, + }, + { + commandConfirm: async (command) => { + expect(command).toBe(`CRTDTAARA DTAARA(QTEMP/TEST) TYPE(*CHAR) LEN(10)`); + return command; + } + } + ); + + expect(result?.code).toBe(0); + }); + it('withTempDirectory and countFiles', async () => { const content = connection.getContent()!; let temp;