Skip to content

Commit

Permalink
Fixed formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
maneesht committed Jan 11, 2025
1 parent d6d2aaf commit 8b45245
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
2 changes: 1 addition & 1 deletion packages/data-connect/src/network/transport/rest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<T, U>(
Expand Down
5 changes: 4 additions & 1 deletion packages/data-connect/test/queries.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<PostListResponse>(dc, 'UnauthorizedQuery');
const invalidTaskListQuery = queryRef<PostListResponse>(
dc,
'UnauthorizedQuery'
);
const message =
'unauthorized: you are not authorized to perform this operation';
await expect(
Expand Down
9 changes: 3 additions & 6 deletions scripts/emulator-testing/emulators/dataconnect-emulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
26 changes: 12 additions & 14 deletions scripts/emulator-testing/emulators/emulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<void> {
Expand All @@ -145,16 +145,14 @@ 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()));
} else {
promise = spawn(
'java',
Expand Down

0 comments on commit 8b45245

Please sign in to comment.