Skip to content

Commit

Permalink
Updated formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
maneesht committed Jan 11, 2025
1 parent 200a2c8 commit f4fbfba
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions scripts/emulator-testing/emulators/emulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,16 +125,17 @@ export abstract class Emulator {

findDataConnectConfigDir() {
let path = './';
const files = fs.readdirSync(path);
console.log(files);
if(files.includes('dataconnect')) {
return path + 'dataconnect';
}
if(files.includes('test')) {
return path + 'test/dataconnect';
}
throw new Error('Max Depth Exceeded. Please run from the data-connect/test folder');

const files = fs.readdirSync(path);
console.log(files);
if (files.includes('dataconnect')) {
return path + 'dataconnect';
}
if (files.includes('test')) {
return path + 'test/dataconnect';
}
throw new Error(
'Max Depth Exceeded. Please run from the data-connect/test folder'
);
}

setUp(): Promise<void> {
Expand All @@ -145,16 +146,18 @@ export abstract class Emulator {
let promise: ChildProcessPromise<SpawnPromiseResult>;
if (this.isDataConnect) {
const dataConnectConfigDir = this.findDataConnectConfigDir();
const password = process.env['POSTGRES_PASSWORD']
const password = process.env['POSTGRES_PASSWORD'];
promise = spawn(this.binaryPath, [
'--v=2',
'dev',
`--listen=127.0.0.1:${this.port},[::1]:${this.port}`,
`--local_connection_string=postgresql://postgres:${password}@localhost:5432/dataconnect-integration?sslmode=disable`,
`--config_dir=${dataConnectConfigDir}`,
`--config_dir=${dataConnectConfigDir}`
]);
promise.childProcess.stdout?.on('data', console.log);
promise.childProcess.stderr?.on('data', res => console.log(res.toString()));
promise.childProcess.stderr?.on('data', res =>
console.log(res.toString())
);
} else {
promise = spawn(
'java',
Expand Down

0 comments on commit f4fbfba

Please sign in to comment.