This repository has been archived by the owner on May 23, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Export mock tracer via standard package; add options to API test harn…
…ess (#98)
- Loading branch information
1 parent
1f32ae4
commit 1b32dfd
Showing
5 changed files
with
49 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
import { expect } from 'chai'; | ||
import {MockTracer } from '../index'; | ||
|
||
function mockTracerimplementationTests(): void { | ||
|
||
describe('Mock Tracer API tests', () => { | ||
|
||
describe ('Tracer#report', () => { | ||
|
||
it ('should not throw exceptions when running report', () => { | ||
const tracer = new MockTracer(); | ||
const span = tracer.startSpan('test_operation'); | ||
span.addTags ({key: 'value'}); | ||
span.finish (); | ||
expect (() => { | ||
const report = tracer.report(); | ||
for (const span of report.spans) { | ||
span.tags(); | ||
} | ||
}).to.not.throw (Error); | ||
}); | ||
}); | ||
}); | ||
} | ||
|
||
export default mockTracerimplementationTests; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters