@@ -294,34 +294,14 @@ describe('Plugin', () => {
294294 agent . close ( { ritmReset : false , wipe : true } )
295295 } )
296296
297- it ( 'should not produce message spans when traceWebsocketMessagesEnabled is not set to true' , ( ) => {
298- wsServer . on ( 'connection' , ( ws ) => {
299- ws . send ( 'test message' )
300- } )
301- messageReceived = false
302-
303- client . on ( 'message' , ( data ) => {
304- assert . strictEqual ( data . toString ( ) , 'test message' )
305- messageReceived = true
306- } )
307-
308- return agent . assertSomeTraces ( traces => {
309- assert . strictEqual ( traces [ 0 ] [ 0 ] . service , 'custom-ws-service' )
310- assert . strictEqual ( traces [ 0 ] [ 0 ] . name , 'web.request' )
311- assert . strictEqual ( traces [ 0 ] [ 0 ] . type , 'websocket' )
312- } )
313- } )
314-
315- it ( 'should not produce close event spans when traceWebsocketMessagesEnabled is not set to true' , ( ) => {
316- wsServer . on ( 'connection' , ( ws ) => {
317- ws . close ( )
318- } )
319-
320- return agent . assertSomeTraces ( traces => {
321- assert . strictEqual ( traces [ 0 ] [ 0 ] . service , 'custom-ws-service' )
322- assert . strictEqual ( traces [ 0 ] [ 0 ] . name , 'web.request' )
323- assert . strictEqual ( traces [ 0 ] [ 0 ] . type , 'websocket' )
324- } )
297+ it ( 'should not initialize sub-plugins when traceWebsocketMessagesEnabled is false' , ( ) => {
298+ const tracer = require ( '../../dd-trace' )
299+ const wsPlugin = tracer . _pluginManager . _pluginsByName . ws
300+
301+ assert . strictEqual ( wsPlugin . server . _enabled , false )
302+ assert . strictEqual ( wsPlugin . producer . _enabled , false )
303+ assert . strictEqual ( wsPlugin . receiver . _enabled , false )
304+ assert . strictEqual ( wsPlugin . close . _enabled , false )
325305 } )
326306 } )
327307 describe ( 'with WebSocket configurations settings' , ( ) => {
0 commit comments