File tree 1 file changed +35
-0
lines changed
1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ 'use strict'
2
+
3
+ const https = require ( 'https' )
4
+ const { expect } = require ( 'chai' )
5
+ const { Tracer } = require ( 'opentracing' )
6
+ const instrumentation = require ( './httpsClient' )
7
+ const httpClient = require ( './httpClient' )
8
+
9
+ describe ( 'instrumentation: httpsClient' , ( ) => {
10
+ let tracer
11
+
12
+ beforeEach ( ( ) => {
13
+ tracer = new Tracer ( )
14
+ } )
15
+
16
+ describe ( '#patch' , ( ) => {
17
+ it ( 'should call httpClient\'s patch' , function ( ) {
18
+ this . sandbox . stub ( httpClient , 'patch' )
19
+
20
+ instrumentation . patch ( https , tracer )
21
+
22
+ expect ( httpClient . patch ) . to . be . calledWith ( https , tracer )
23
+ } )
24
+ } )
25
+
26
+ describe ( '#unpatch' , ( ) => {
27
+ it ( 'should call httpClient\'s unpatch' , function ( ) {
28
+ this . sandbox . stub ( httpClient , 'unpatch' )
29
+
30
+ instrumentation . unpatch ( https , tracer )
31
+
32
+ expect ( httpClient . unpatch ) . to . be . calledWith ( https )
33
+ } )
34
+ } )
35
+ } )
You can’t perform that action at this time.
0 commit comments