@@ -4,20 +4,32 @@ const tracer = require('dd-trace')
44const assert = require ( 'assert' )
55
66const sum = require ( '../test/sum' )
7- describe ( 'test optimization custom tags ' , ( ) => {
7+ describe ( 'test optimization' , ( ) => {
88 beforeEach ( ( ) => {
99 const testSpan = tracer . scope ( ) . active ( )
10- testSpan . setTag ( 'custom_tag .beforeEach' , 'true' )
10+ testSpan . setTag ( 'outer_scope .beforeEach' , 'true' )
1111 } )
1212
13- it ( 'can report tests' , ( ) => {
14- const testSpan = tracer . scope ( ) . active ( )
15- testSpan . setTag ( 'custom_tag.it' , 'true' )
16- assert . strictEqual ( sum ( 1 , 2 ) , 3 )
13+ describe ( 'custom tags' , ( ) => {
14+ beforeEach ( ( ) => {
15+ const testSpan = tracer . scope ( ) . active ( )
16+ testSpan . setTag ( 'custom_tag.beforeEach' , 'true' )
17+ } )
18+
19+ it ( 'can report tests' , ( ) => {
20+ const testSpan = tracer . scope ( ) . active ( )
21+ testSpan . setTag ( 'custom_tag.it' , 'true' )
22+ assert . strictEqual ( sum ( 1 , 2 ) , 3 )
23+ } )
24+
25+ afterEach ( ( ) => {
26+ const testSpan = tracer . scope ( ) . active ( )
27+ testSpan . setTag ( 'custom_tag.afterEach' , 'true' )
28+ } )
1729 } )
1830
1931 afterEach ( ( ) => {
2032 const testSpan = tracer . scope ( ) . active ( )
21- testSpan . setTag ( 'custom_tag .afterEach' , 'true' )
33+ testSpan . setTag ( 'outer_scope .afterEach' , 'true' )
2234 } )
2335} )
0 commit comments