Skip to content

Commit

Permalink
Fix linting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
sethmaxwl committed Aug 12, 2020
1 parent d4996b9 commit 0606f83
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"presystem-test": "npm run compile",
"system-test": "mocha build/system-test --timeout 600000",
"samples-test": "cd samples/ && npm link ../ && npm install && npm test && cd ../",
"test": "c8 mocha build/test",
"test": "c8 mocha build/test --recursive",
"lint": "gts check",
"predocs": "npm run compile",
"docs": "jsdoc -c .jsdoc.js",
Expand Down
7 changes: 4 additions & 3 deletions src/publisher/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,10 @@ export class Publisher {
this.topic = topic;
this.queue = new Queue(this);
this.orderedQueues = new Map();
this.tracing = this.settings && this.settings.enableOpenTelemetryTracing
? new OpenTelemetryTracer()
: undefined;
this.tracing =
this.settings && this.settings.enableOpenTelemetryTracing
? new OpenTelemetryTracer()
: undefined;
}

flush(): Promise<void>;
Expand Down
4 changes: 3 additions & 1 deletion src/subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,9 @@ export class Subscriber extends EventEmitter {
this.maxMessages
);
}
this._tracing = (options.enableOpenTelemetryTracing) ? new OpenTelemetryTracer() : undefined;
this._tracing = options.enableOpenTelemetryTracing
? new OpenTelemetryTracer()
: undefined;
}

/**
Expand Down
16 changes: 10 additions & 6 deletions test/publisher/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ const fakePromisify = Object.assign({}, pfy, {
}
promisified = true;
assert.ok(options.singular);
assert.deepStrictEqual(options.exclude, ['publish', 'setOptions', 'constructSpan']);
assert.deepStrictEqual(options.exclude, [
'publish',
'setOptions',
'constructSpan',
]);
},
});

Expand Down Expand Up @@ -147,9 +151,9 @@ describe('Publisher', () => {
});

describe('OpenTelemetry tracing', () => {
let tracingPublisher: any = {};
let tracingPublisher: p.Publisher = {} as p.Publisher;
const enableTracing: p.PublishOptions = {
enableOpenTelemetryTracing: true
enableOpenTelemetryTracing: true,
};
beforeEach(() => {
// Declare tracingPublisher as type any and pre-define _tracing
Expand Down Expand Up @@ -295,7 +299,7 @@ describe('Publisher', () => {
};
const fakeMessageWithOTKey = {data, attributes};
const publisherTracing = new Publisher(topic, {
enableOpenTelemetryTracing: true
enableOpenTelemetryTracing: true,
});
publisherTracing.publishMessage(fakeMessageWithOTKey, warnSpy);
assert.ok(warnSpy.called);
Expand Down Expand Up @@ -334,7 +338,7 @@ describe('Publisher', () => {
gaxOpts: {
isBundling: false,
},
enableOpenTelemetryTracing: false
enableOpenTelemetryTracing: false,
});
});

Expand All @@ -349,7 +353,7 @@ describe('Publisher', () => {
gaxOpts: {
isBundling: true,
},
enableOpenTelemetryTracing: true
enableOpenTelemetryTracing: true,
};

publisher.setOptions(options);
Expand Down
4 changes: 2 additions & 2 deletions test/subscriber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -632,9 +632,9 @@ describe('Subscriber', () => {
});

describe('OpenTelemetry tracing', () => {
let tracingSubscriber: any = {};
let tracingSubscriber: s.Subscriber = {} as s.Subscriber;
const enableTracing: s.SubscriberOptions = {
enableOpenTelemetryTracing: true
enableOpenTelemetryTracing: true,
};
beforeEach(() => {
// Declare tracingSubscriber as type any and pre-define _tracing
Expand Down

0 comments on commit 0606f83

Please sign in to comment.