Skip to content

Commit

Permalink
fix(otlp-exporters): remove more 'if's for undefined checks from tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
pichlermarc committed May 4, 2022
1 parent 47aa7e4 commit 2dcb4c1
Showing 1 changed file with 12 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,26 +228,20 @@ const testCollectorExporter = (params: TestParams) =>
typeof exportedData !== 'undefined',
'resource' + " doesn't exist"
);
let spans;
let resource;
if (exportedData) {
spans = exportedData.scopeSpans[0].spans;
resource = exportedData.resource;

assert.ok(
typeof spans !== 'undefined',
'spans do not exist'
);
ensureExportedSpanIsCorrect(spans[0]);

assert.ok(
typeof resource !== 'undefined',
"resource doesn't exist"
);
const spans = exportedData.scopeSpans[0].spans;
const resource = exportedData.resource;

ensureResourceIsCorrect(resource);
assert.ok(
typeof spans !== 'undefined',
'spans do not exist'
);
ensureExportedSpanIsCorrect(spans[0]);

}
assert.ok(
typeof resource !== 'undefined',
"resource doesn't exist"
);
ensureResourceIsCorrect(resource);

ensureMetadataIsCorrect(reqMetadata, params.metadata);

Expand Down

0 comments on commit 2dcb4c1

Please sign in to comment.