Skip to content

Commit b5a8c4e

Browse files
committed
Removed console.logs
1 parent 338f970 commit b5a8c4e

File tree

6 files changed

+18
-153
lines changed

6 files changed

+18
-153
lines changed

.github/workflows/test-all.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ jobs:
9292
- name: Run unit tests
9393
# Ignore auth data-connect and firestore since they're handled in their own separate jobs.
9494
run: |
95-
xvfb-run yarn lerna run --ignore '{firebase-messaging-integration-test,@firebase/auth*,@firebase/data-connect*,@firebase/firestore*,firebase-firestore-integration-test}' test:ci
95+
xvfb-run yarn lerna run --ignore '{firebase-messaging-integration-test,@firebase/auth*,@firebase/firestore*,firebase-firestore-integration-test}' test:ci
9696
node scripts/print_test_logs.js
9797
env:
9898
FIREBASE_TOKEN: ${{ secrets.FIREBASE_CLI_TOKEN }}

.github/workflows/test-changed-data-connect.yml

Lines changed: 0 additions & 126 deletions
This file was deleted.

packages/data-connect/test/unit/dataconnect.test.ts

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,11 @@
1818
import { deleteApp, initializeApp } from '@firebase/app';
1919
import { expect } from 'chai';
2020

21-
import { ConnectorConfig, getDataConnect } from '../../src';
21+
import { getDataConnect } from '../../src';
2222

2323
describe('Data Connect Test', () => {
24+
beforeEach(() => {
25+
});
2426
it('should throw an error if `projectId` is not provided', async () => {
2527
const app = initializeApp({ projectId: undefined }, 'a');
2628
expect(() =>
@@ -30,24 +32,27 @@ describe('Data Connect Test', () => {
3032
);
3133
await deleteApp(app);
3234
});
33-
it('should not throw an error if `projectId` is provided', () => {
35+
it('should not throw an error if `projectId` is provided', async () => {
3436
const projectId = 'p';
35-
initializeApp({ projectId });
37+
const customApp = initializeApp({ projectId }, 'customApp');
3638
expect(() =>
3739
getDataConnect({ connector: 'c', location: 'l', service: 's' })
3840
).to.not.throw(
3941
'Project ID must be provided. Did you pass in a proper projectId to initializeApp?'
4042
);
41-
const dc = getDataConnect({ connector: 'c', location: 'l', service: 's' });
43+
const dc = getDataConnect(customApp, { connector: 'c', location: 'l', service: 's' });
4244
expect(dc.app.options.projectId).to.eq(projectId);
45+
await deleteApp(customApp);
4346
});
44-
it('should throw an error if `connectorConfig` is not provided', () => {
47+
it('should throw an error if `connectorConfig` is not provided', async () => {
4548
const projectId = 'p';
46-
initializeApp({ projectId });
47-
expect(() => getDataConnect({} as ConnectorConfig)).to.throw(
49+
const customApp = initializeApp({ projectId }, 'customApp');
50+
// @ts-ignore
51+
expect(() => getDataConnect(customApp)).to.throw(
4852
'DC Option Required'
4953
);
50-
const dc = getDataConnect({ connector: 'c', location: 'l', service: 's' });
54+
const dc = getDataConnect(customApp, { connector: 'c', location: 'l', service: 's' });
5155
expect(dc.app.options.projectId).to.eq(projectId);
56+
await deleteApp(customApp);
5257
});
5358
});

packages/data-connect/test/unit/utils.test.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,12 @@
1515
* limitations under the License.
1616
*/
1717

18-
import { deleteApp, FirebaseApp, initializeApp } from '@firebase/app';
1918
import { expect } from 'chai';
2019

2120
import { getDataConnect } from '../../src';
2221
import { validateArgs } from '../../src/util/validateArgs';
22+
import { app } from '../util';
2323
describe('Utils', () => {
24-
let defaultApp: FirebaseApp;
25-
beforeEach(() => {
26-
defaultApp = initializeApp({ projectId: 'p' });
27-
});
28-
afterEach(async () => {
29-
await deleteApp(defaultApp);
30-
});
3124
it('[Vars required: true] should throw if no arguments are provided', () => {
3225
const connectorConfig = { connector: 'c', location: 'l', service: 's' };
3326
expect(() =>
@@ -36,20 +29,20 @@ describe('Utils', () => {
3629
});
3730
it('[vars required: false, vars provided: false] should return data connect instance and no variables', () => {
3831
const connectorConfig = { connector: 'c', location: 'l', service: 's' };
39-
const dc = getDataConnect(connectorConfig);
32+
const dc = getDataConnect(app, connectorConfig);
4033
expect(validateArgs(connectorConfig)).to.deep.eq({ dc, vars: undefined });
4134
});
4235
it('[vars required: false, vars provided: false, data connect provided: true] should return data connect instance and no variables', () => {
4336
const connectorConfig = { connector: 'c', location: 'l', service: 's' };
44-
const dc = getDataConnect(connectorConfig);
37+
const dc = getDataConnect(app, connectorConfig);
4538
expect(validateArgs(connectorConfig, dc)).to.deep.eq({
4639
dc,
4740
vars: undefined
4841
});
4942
});
5043
it('[vars required: true, vars provided: true, data connect provided: true] should return data connect instance and variables', () => {
5144
const connectorConfig = { connector: 'c', location: 'l', service: 's' };
52-
const dc = getDataConnect(connectorConfig);
45+
const dc = getDataConnect(app, connectorConfig);
5346
const vars = { a: 1 };
5447
expect(validateArgs(connectorConfig, dc, vars)).to.deep.eq({ dc, vars });
5548
});

packages/data-connect/test/util.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {
2626

2727
export const EMULATOR_PORT = process.env.DC_EMULATOR_PORT;
2828
// eslint-disable-next-line no-console
29-
console.log('Emulator Port: ' + EMULATOR_PORT);
3029
const USE_EMULATOR = !!EMULATOR_PORT;
3130
export const CONNECTOR_NAME = 'tests';
3231
export const LOCATION_NAME = 'us-west2';
@@ -49,9 +48,6 @@ export function initDatabase(): DataConnect {
4948
const instance = getDataConnect(getConnectionConfig());
5049
if (USE_EMULATOR) {
5150
connectDataConnectEmulator(instance, 'localhost', Number(EMULATOR_PORT));
52-
} else {
53-
// eslint-disable-next-line no-console
54-
console.log('not running emulator');
5551
}
5652
return instance;
5753
}

scripts/ci-test/testConfig.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,5 @@ export const testConfig: {
7676
},
7777
'auth': {
7878
'onlyIncludePackages': ['@firebase/auth', '@firebase/auth-compat']
79-
},
80-
'data-connect': {
81-
'onlyIncludePackages': ['@firebase/data-connect']
8279
}
8380
};

0 commit comments

Comments
 (0)