|
14 | 14 | * limitations under the License.
|
15 | 15 | */
|
16 | 16 |
|
17 |
| -import {CoreTracer, RootSpan, Span, SpanEventListener, SpanKind} from '@opencensus/core'; |
18 |
| -import {logger} from '@opencensus/core'; |
| 17 | +import {CoreTracer, RootSpan, SpanEventListener, SpanKind} from '@opencensus/core'; |
19 | 18 | import * as assert from 'assert';
|
20 |
| -import {accessSync} from 'fs'; |
21 |
| -import * as http from 'http'; |
22 |
| -import * as mocha from 'mocha'; |
23 | 19 | import * as mongodb from 'mongodb';
|
24 |
| -import * as semver from 'semver'; |
25 |
| - |
26 | 20 | import {plugin} from '../src/';
|
27 |
| -import {MongoDBPlugin} from '../src/'; |
28 | 21 |
|
29 | 22 | export type MongoDBAccess = {
|
30 | 23 | client: mongodb.MongoClient,
|
@@ -110,7 +103,7 @@ describe('MongoDBPlugin', () => {
|
110 | 103 | before((done) => {
|
111 | 104 | tracer.start({samplingRate: 1});
|
112 | 105 | tracer.registerSpanEventListener(rootSpanVerifier);
|
113 |
| - plugin.enable(mongodb, tracer, VERSION, {}, null); |
| 106 | + plugin.enable(mongodb, tracer, VERSION, {}, ''); |
114 | 107 | accessCollection(URL, DB_NAME, COLLECTION_NAME)
|
115 | 108 | .then(result => {
|
116 | 109 | client = result.client;
|
@@ -218,7 +211,7 @@ describe('MongoDBPlugin', () => {
|
218 | 211 | describe('Instrumenting command operations', () => {
|
219 | 212 | it('should create a child span for create index', (done) => {
|
220 | 213 | tracer.startRootSpan({name: 'indexRootSpan'}, (rootSpan: RootSpan) => {
|
221 |
| - collection.createIndex({a: 1}, null, (err, result) => { |
| 214 | + collection.createIndex({a: 1}, (err, result) => { |
222 | 215 | assert.strictEqual(rootSpanVerifier.endedRootSpans.length, 0);
|
223 | 216 | rootSpan.end();
|
224 | 217 | assert.ifError(err);
|
@@ -282,7 +275,7 @@ describe('MongoDBPlugin', () => {
|
282 | 275 |
|
283 | 276 | it('should not create a child span for command', (done) => {
|
284 | 277 | tracer.startRootSpan({name: 'indexRootSpan'}, (rootSpan: RootSpan) => {
|
285 |
| - collection.createIndex({a: 1}, null, (err, result) => { |
| 278 | + collection.createIndex({a: 1}, (err, result) => { |
286 | 279 | assert.strictEqual(rootSpanVerifier.endedRootSpans.length, 0);
|
287 | 280 | rootSpan.end();
|
288 | 281 | assert.ifError(err);
|
|
0 commit comments