Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix base scope missing the _activate protected method #791

Merged
merged 2 commits into from
Dec 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/dd-trace/src/scope/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ class Scope {
return null
}

_activate (span, callback) {
return callback()
}

_bindFn (fn, span) {
if (typeof fn !== 'function') return fn

Expand Down
22 changes: 22 additions & 0 deletions packages/dd-trace/test/scope/base.spec.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
'use strict'

const Scope = require('../../src/scope/base')

wrapIt()

describe('Scope (base)', () => {
let scope

beforeEach(() => {
scope = new Scope({
experimental: {}
})
})

it('should be a no-op when activating', done => {
scope.activate({}, () => {
expect(scope.active()).to.be.null
done()
})
})
})