Skip to content

Commit

Permalink
Fix lint errors and add changelog entry
Browse files Browse the repository at this point in the history
  • Loading branch information
mattolson committed Jun 17, 2022
1 parent 2f40661 commit 29272fd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions experimental/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ All notable changes to experimental packages in this project will be documented

* fix(otlp-transformer): remove type dependency on Long #3022 @legendecas
* fix(grpc-exporter): use non-normalized URL to determine channel security #3019 @pichlermarc
* fix(otlp-exporter-base): fix gzip output stream in http otlp export #3046 @mattolson

### :books: (Refine Doc)

Expand Down
18 changes: 9 additions & 9 deletions experimental/packages/otlp-exporter-base/test/node/util.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class HttpResponse extends PassThrough {
statusCode: number;
statusMessage: string;

constructor(statusCode: number = 200, statusMessage: string = 'OK') {
constructor(statusCode = 200, statusMessage = 'OK') {
super();
this.statusCode = statusCode;
this.statusMessage = statusMessage;
Expand Down Expand Up @@ -171,7 +171,7 @@ describe('sendWithHttp', () => {
let mockRequest: HttpRequest;
let setHeaderSpy: sinon.SinonSpy;

let spanData: object = {
const spanData: object = {
'foo': 'bar',
'bar': 'baz',
};
Expand All @@ -193,18 +193,18 @@ describe('sendWithHttp', () => {
// Mock out response
const response = new HttpResponse();
response.end('OK');

// Stub out http.request so it calls our callback with the mocked response
// and also so it returns our mocked request stream so we can observe. We don't
// really care about the response for the purpose of this test, but we do want
// to observe the request compression behavior.
httpRequestStub.returns(mockRequest).callsArgWith(1, response);
httpRequestStub.returns(mockRequest).callsArgWith(1, response);
});

afterEach(function() {
httpRequestStub.restore();
httpRequestStub.restore();
setHeaderSpy.restore();
});
});

it('should send with no compression if configured to do so', () => {
exporter = new Exporter(exporterConfig);
Expand All @@ -219,7 +219,7 @@ describe('sendWithHttp', () => {

sendWithHttp(exporter, data, 'application/json', () => {
// Show that we aren't setting the gzip encoding header
assert(setHeaderSpy.withArgs('Content-Encoding', 'gzip').notCalled)
assert(setHeaderSpy.withArgs('Content-Encoding', 'gzip').notCalled);
}, (err: OTLPExporterError) => {
assert.fail(err);
});
Expand Down Expand Up @@ -267,7 +267,7 @@ describe('sendWithHttp', () => {

const response = new HttpResponse();
response.end('OK');

httpRequestStub.restore();
httpRequestStub = sinon.stub(http, 'request');
httpRequestStub.returns(mockRequest).callsArgWith(1, response);
Expand All @@ -287,4 +287,4 @@ describe('sendWithHttp', () => {
});
}
});
});
});

0 comments on commit 29272fd

Please sign in to comment.