From 8b452453d6af545f60f868446b33a80c767b00a1 Mon Sep 17 00:00:00 2001 From: Maneesh Tewani Date: Fri, 10 Jan 2025 16:04:45 -0800 Subject: [PATCH] Fixed formatting --- .../src/network/transport/rest.ts | 2 +- packages/data-connect/test/queries.test.ts | 5 +++- .../emulators/dataconnect-emulator.ts | 9 +++---- .../emulator-testing/emulators/emulator.ts | 26 +++++++++---------- 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/packages/data-connect/src/network/transport/rest.ts b/packages/data-connect/src/network/transport/rest.ts index 7d3bdd3ae46..7c8500b733d 100644 --- a/packages/data-connect/src/network/transport/rest.ts +++ b/packages/data-connect/src/network/transport/rest.ts @@ -166,7 +166,7 @@ export class RESTTransport implements DataConnectTransport { body: U ) => { const abortController = new AbortController(); - + // TODO(mtewani): Update to proper value const withAuth = this.withRetry(() => dcFetch( diff --git a/packages/data-connect/test/queries.test.ts b/packages/data-connect/test/queries.test.ts index 2ec2cbfb88f..c6f88abcec5 100644 --- a/packages/data-connect/test/queries.test.ts +++ b/packages/data-connect/test/queries.test.ts @@ -161,7 +161,10 @@ describe('DataConnect Tests', async () => { ); }); it('throws an error with just the message when the server responds with an error', async () => { - const invalidTaskListQuery = queryRef(dc, 'UnauthorizedQuery'); + const invalidTaskListQuery = queryRef( + dc, + 'UnauthorizedQuery' + ); const message = 'unauthorized: you are not authorized to perform this operation'; await expect( diff --git a/scripts/emulator-testing/emulators/dataconnect-emulator.ts b/scripts/emulator-testing/emulators/dataconnect-emulator.ts index e1169859af3..60aa886003a 100644 --- a/scripts/emulator-testing/emulators/dataconnect-emulator.ts +++ b/scripts/emulator-testing/emulators/dataconnect-emulator.ts @@ -26,16 +26,13 @@ export class DataConnectEmulator extends Emulator { let urlString = ''; switch (os) { case 'darwin': - urlString = - `https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/emulator%2Fdataconnect-emulator-macos-v${DATACONNECT_EMULATOR_VERSION}?alt=media`; + urlString = `https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/emulator%2Fdataconnect-emulator-macos-v${DATACONNECT_EMULATOR_VERSION}?alt=media`; break; case 'linux': - urlString = - `https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/emulator%2Fdataconnect-emulator-linux-v${DATACONNECT_EMULATOR_VERSION}?alt=media`; + urlString = `https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/emulator%2Fdataconnect-emulator-linux-v${DATACONNECT_EMULATOR_VERSION}?alt=media`; break; case 'win32': - urlString = - `https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/emulator%2Fdataconnect-emulator-windows-v${DATACONNECT_EMULATOR_VERSION}?alt=media`; + urlString = `https://firebasestorage.googleapis.com/v0/b/firemat-preview-drop/o/emulator%2Fdataconnect-emulator-windows-v${DATACONNECT_EMULATOR_VERSION}?alt=media`; break; default: throw new Error( diff --git a/scripts/emulator-testing/emulators/emulator.ts b/scripts/emulator-testing/emulators/emulator.ts index 923a732d5ad..0985180ba13 100644 --- a/scripts/emulator-testing/emulators/emulator.ts +++ b/scripts/emulator-testing/emulators/emulator.ts @@ -125,16 +125,16 @@ 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); + 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 { @@ -145,16 +145,14 @@ export abstract class Emulator { let promise: ChildProcessPromise; 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())); } else { promise = spawn( 'java',