Skip to content

Commit e66c193

Browse files
committed
Fix tests
1 parent 5ed242e commit e66c193

File tree

2 files changed

+4
-15
lines changed

2 files changed

+4
-15
lines changed

packages/telemetry/src/api.test.ts

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import { _FirebaseInstallationsInternal } from '@firebase/installations';
4242
const PROJECT_ID = 'my-project';
4343
const APP_ID = 'my-appid';
4444
const API_KEY = 'my-api-key';
45-
const FID = 'fid-1234';
4645

4746
const emittedLogs: LogRecord[] = [];
4847

@@ -70,8 +69,7 @@ const fakeTelemetry: Telemetry = {
7069
appId: APP_ID
7170
}
7271
},
73-
loggerProvider: fakeLoggerProvider,
74-
fid: FID
72+
loggerProvider: fakeLoggerProvider
7573
};
7674

7775
describe('Top level API', () => {
@@ -127,7 +125,6 @@ describe('Top level API', () => {
127125
expect(log.severityNumber).to.equal(SeverityNumber.ERROR);
128126
expect(log.body).to.equal('This is a test error');
129127
expect(log.attributes).to.deep.equal({
130-
'user.id': FID,
131128
'error.type': 'TestError',
132129
'error.stack': '...stack trace...'
133130
});
@@ -144,7 +141,6 @@ describe('Top level API', () => {
144141
expect(log.severityNumber).to.equal(SeverityNumber.ERROR);
145142
expect(log.body).to.equal('error with no stack');
146143
expect(log.attributes).to.deep.equal({
147-
'user.id': FID,
148144
'error.type': 'Error',
149145
'error.stack': 'No stack trace available'
150146
});
@@ -157,9 +153,7 @@ describe('Top level API', () => {
157153
const log = emittedLogs[0];
158154
expect(log.severityNumber).to.equal(SeverityNumber.ERROR);
159155
expect(log.body).to.equal('a string error');
160-
expect(log.attributes).to.deep.equal({
161-
'user.id': 'fid-1234'
162-
});
156+
expect(log.attributes).to.deep.equal({});
163157
});
164158

165159
it('should capture an unknown error type correctly', () => {
@@ -169,9 +163,7 @@ describe('Top level API', () => {
169163
const log = emittedLogs[0];
170164
expect(log.severityNumber).to.equal(SeverityNumber.ERROR);
171165
expect(log.body).to.equal('Unknown error type: number');
172-
expect(log.attributes).to.deep.equal({
173-
'user.id': 'fid-1234'
174-
});
166+
expect(log.attributes).to.deep.equal({});
175167
});
176168

177169
it('should propagate trace context', async () => {
@@ -195,7 +187,6 @@ describe('Top level API', () => {
195187
await provider.shutdown();
196188

197189
expect(emittedLogs[0].attributes).to.deep.equal({
198-
'user.id': FID,
199190
'error.type': 'TestError',
200191
'error.stack': '...stack trace...',
201192
'logging.googleapis.com/trace': `projects/${PROJECT_ID}/traces/my-trace`,
@@ -220,7 +211,6 @@ describe('Top level API', () => {
220211
expect(emittedLogs.length).to.equal(1);
221212
const log = emittedLogs[0];
222213
expect(log.attributes).to.deep.equal({
223-
'user.id': FID,
224214
'error.type': 'TestError',
225215
'error.stack': '...stack trace...',
226216
strAttr: 'string attribute',
@@ -254,7 +244,7 @@ function getFakeApp(): FirebaseApp {
254244
'installations-internal',
255245
() =>
256246
({
257-
getId: async () => 'FID',
247+
getId: async () => 'iid',
258248
getToken: async () => 'authToken'
259249
} as _FirebaseInstallationsInternal),
260250
ComponentType.PUBLIC

packages/telemetry/src/logging/logger-provider.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import { FetchTransport } from './fetch-transport';
3333
import { DynamicHeaderProvider, DynamicLogAttributeProvider } from '../types';
3434
import { FirebaseApp } from '@firebase/app';
3535
import { ExportResult } from '@opentelemetry/core';
36-
import { _FirebaseInstallationsInternal } from '@firebase/installations';
3736

3837
/**
3938
* Create a logger provider for the current execution environment.

0 commit comments

Comments
 (0)