Skip to content

Commit

Permalink
fix(otlp-http-exporter): fix tests
Browse files Browse the repository at this point in the history
Signed-off-by: Svetlana Brennan <svetlana.svn@gmail.com>
  • Loading branch information
svetlanabrennan committed Apr 5, 2022
1 parent 3a7ea3c commit 7f2b72f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ describe('OTLPMetricExporter - node with json over http', () => {
describe('export', () => {
beforeEach(async () => {
stubRequest = sinon.stub(http, 'request').returns(fakeRequest as any);
stubWrite = sinon.stub(fakeRequest, 'write');
stubWrite = sinon.stub(fakeRequest, 'end');
collectorExporterConfig = {
headers: {
foo: 'bar',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@ describe('OTLPMetricExporter - node with proto over http', () => {
collectorExporter.export(metrics, () => {});

sinon.stub(http, 'request').returns({
end: () => {},
write: () => {},
on: () => {},
write: (...writeArgs: any[]) => {
end: (...writeArgs: any[]) => {
const ExportTraceServiceRequestProto = getExportRequestProto();
const data = ExportTraceServiceRequestProto?.decode(writeArgs[0]);
const json = data?.toJSON() as otlpTypes.opentelemetryProto.collector.metrics.v1.ExportMetricsServiceRequest;
Expand Down

0 comments on commit 7f2b72f

Please sign in to comment.