Skip to content

Commit

Permalink
add trace to test mock
Browse files Browse the repository at this point in the history
  • Loading branch information
nhanphan committed Nov 19, 2019
1 parent 568f46a commit f27b8d5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/instrumentation/express.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ describe('instrumentation: express', () => {
mockSpan = {
setTag: this.sandbox.spy(),
log: this.sandbox.spy(),
finish: this.sandbox.spy()
finish: this.sandbox.spy(),
context: () => {return {traceIdStr: 'cd085dc813af7cb1'}}
}

this.sandbox.stub(cls, 'startRootSpan').callsFake(() => mockSpan)
Expand Down
6 changes: 4 additions & 2 deletions src/instrumentation/expressError.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ describe('instrumentation: expressError', () => {
beforeEach(function () {
tracer = new Tracer()
mockRootSpan = {
setTag: this.sandbox.spy()
setTag: this.sandbox.spy(),
context: () => {return {traceIdStr: 'cd085dc813af7cb1'}}
}
mockChildSpan = {
setTag: this.sandbox.spy(),
log: this.sandbox.spy(),
finish: this.sandbox.spy()
finish: this.sandbox.spy(),
context: () => {return {traceIdStr: 'cd085dc813af7cb1'}}
}

this.sandbox.stub(cls, 'getRootSpan').callsFake(() => mockRootSpan)
Expand Down

0 comments on commit f27b8d5

Please sign in to comment.