@@ -6,20 +6,10 @@ const ddBasePath = calculateDDBasePath(__dirname)
6
6
const EOL = '\n'
7
7
8
8
describe ( 'IAST log' , ( ) => {
9
- const telemetryDebugConfig = {
10
- config : {
11
- telemetry : {
12
- logCollection : true ,
13
- diagnosticLogCollection : true
14
- }
15
- }
16
- }
17
-
18
9
const telemetryDefaultConfig = {
19
10
config : {
20
11
telemetry : {
21
- logCollection : true ,
22
- diagnosticLogCollection : false
12
+ logCollection : true
23
13
}
24
14
}
25
15
}
@@ -77,81 +67,6 @@ describe('IAST log', () => {
77
67
telemetryLogs . stop ( )
78
68
} )
79
69
80
- describe ( 'debug' , ( ) => {
81
- it ( 'should call log.debug' , ( ) => {
82
- iastLog . debug ( 'debug' )
83
-
84
- expect ( log . debug ) . to . be . calledOnceWith ( 'debug' )
85
- } )
86
-
87
- it ( 'should call log.debug and not publish msg via telemetry' , ( ) => {
88
- iastLog . debugAndPublish ( 'debug' )
89
-
90
- expect ( log . debug ) . to . be . calledOnceWith ( 'debug' )
91
- expect ( telemetryLogs . publish ) . to . not . be . called
92
- } )
93
-
94
- it ( 'should call log.debug and publish msg via telemetry' , ( ) => {
95
- onTelemetryStart ( telemetryDebugConfig )
96
-
97
- iastLog . debugAndPublish ( 'debug' )
98
-
99
- expect ( log . debug ) . to . be . calledOnceWith ( 'debug' )
100
- expect ( telemetryLogs . publish ) . to . be . calledOnceWith ( { message : 'debug' , level : 'DEBUG' } )
101
- } )
102
-
103
- it ( 'should chain multiple debug calls' , ( ) => {
104
- onTelemetryStart ( telemetryDebugConfig )
105
-
106
- iastLog . debug ( 'debug' ) . debugAndPublish ( 'debugAndPublish' ) . debug ( 'debug2' )
107
-
108
- expect ( log . debug ) . to . be . calledThrice
109
- expect ( log . debug . getCall ( 0 ) . args [ 0 ] ) . to . be . eq ( 'debug' )
110
- expect ( log . debug . getCall ( 1 ) . args [ 0 ] ) . to . be . eq ( 'debugAndPublish' )
111
- expect ( log . debug . getCall ( 2 ) . args [ 0 ] ) . to . be . eq ( 'debug2' )
112
- expect ( telemetryLogs . publish ) . to . be . calledOnceWith ( { message : 'debugAndPublish' , level : 'DEBUG' } )
113
- } )
114
-
115
- it ( 'should chain multiple debug calls' , ( ) => {
116
- onTelemetryStart ( telemetryDebugConfig )
117
-
118
- iastLog . debug ( 'debug' )
119
-
120
- telemetryLogs . stop ( )
121
-
122
- iastLog . debugAndPublish ( 'debugAndPublish' ) . debug ( 'debug2' )
123
- } )
124
- } )
125
-
126
- describe ( 'info' , ( ) => {
127
- it ( 'should call log.info' , ( ) => {
128
- iastLog . info ( 'info' )
129
-
130
- expect ( log . info ) . to . be . calledOnceWith ( 'info' )
131
- } )
132
-
133
- it ( 'should call log.info and publish msg via telemetry' , ( ) => {
134
- onTelemetryStart ( telemetryDebugConfig )
135
-
136
- iastLog . infoAndPublish ( 'info' )
137
-
138
- expect ( log . info ) . to . be . calledOnceWith ( 'info' )
139
- expect ( telemetryLogs . publish ) . to . be . calledOnceWith ( { message : 'info' , level : 'DEBUG' } )
140
- } )
141
-
142
- it ( 'should chain multiple info calls' , ( ) => {
143
- onTelemetryStart ( telemetryDebugConfig )
144
-
145
- iastLog . info ( 'info' ) . infoAndPublish ( 'infoAndPublish' ) . info ( 'info2' )
146
-
147
- expect ( log . info ) . to . be . calledThrice
148
- expect ( log . info . getCall ( 0 ) . args [ 0 ] ) . to . be . eq ( 'info' )
149
- expect ( log . info . getCall ( 1 ) . args [ 0 ] ) . to . be . eq ( 'infoAndPublish' )
150
- expect ( log . info . getCall ( 2 ) . args [ 0 ] ) . to . be . eq ( 'info2' )
151
- expect ( telemetryLogs . publish ) . to . be . calledOnceWith ( { message : 'infoAndPublish' , level : 'DEBUG' } )
152
- } )
153
- } )
154
-
155
70
describe ( 'warn' , ( ) => {
156
71
it ( 'should call log.warn' , ( ) => {
157
72
iastLog . warn ( 'warn' )
0 commit comments