1616
1717import * as assert from 'assert' ;
1818import {
19- createBaggage ,
20- setBaggage ,
21- getBaggage ,
2219 ROOT_CONTEXT ,
20+ propagation ,
2321 baggageEntryMetadataFromString ,
2422} from '../../src' ;
2523
2624describe ( 'Baggage' , ( ) => {
2725 describe ( 'create' , ( ) => {
2826 it ( 'should create an empty bag' , ( ) => {
29- const bag = createBaggage ( ) ;
27+ const bag = propagation . createBaggage ( ) ;
3028
3129 assert . deepStrictEqual ( bag . getAllEntries ( ) , [ ] ) ;
3230 } ) ;
3331
3432 it ( 'should create a bag with entries' , ( ) => {
3533 const meta = baggageEntryMetadataFromString ( 'opaque string' ) ;
36- const bag = createBaggage ( {
34+ const bag = propagation . createBaggage ( {
3735 key1 : { value : 'value1' } ,
3836 key2 : { value : 'value2' , metadata : meta } ,
3937 } ) ;
@@ -47,7 +45,9 @@ describe('Baggage', () => {
4745
4846 describe ( 'get' , ( ) => {
4947 it ( 'should not allow modification of returned entries' , ( ) => {
50- const bag = createBaggage ( ) . setEntry ( 'key' , { value : 'value' } ) ;
48+ const bag = propagation
49+ . createBaggage ( )
50+ . setEntry ( 'key' , { value : 'value' } ) ;
5151
5252 const entry = bag . getEntry ( 'key' ) ;
5353 assert . ok ( entry ) ;
@@ -59,7 +59,7 @@ describe('Baggage', () => {
5959
6060 describe ( 'set' , ( ) => {
6161 it ( 'should create a new bag when an entry is added' , ( ) => {
62- const bag = createBaggage ( ) ;
62+ const bag = propagation . createBaggage ( ) ;
6363
6464 const bag2 = bag . setEntry ( 'key' , { value : 'value' } ) ;
6565
@@ -73,7 +73,7 @@ describe('Baggage', () => {
7373
7474 describe ( 'remove' , ( ) => {
7575 it ( 'should create a new bag when an entry is removed' , ( ) => {
76- const bag = createBaggage ( {
76+ const bag = propagation . createBaggage ( {
7777 key : { value : 'value' } ,
7878 } ) ;
7979
@@ -87,7 +87,7 @@ describe('Baggage', () => {
8787 } ) ;
8888
8989 it ( 'should create an empty bag multiple keys are removed' , ( ) => {
90- const bag = createBaggage ( {
90+ const bag = propagation . createBaggage ( {
9191 key : { value : 'value' } ,
9292 key1 : { value : 'value1' } ,
9393 key2 : { value : 'value2' } ,
@@ -107,7 +107,7 @@ describe('Baggage', () => {
107107 } ) ;
108108
109109 it ( 'should create an empty bag when it cleared' , ( ) => {
110- const bag = createBaggage ( {
110+ const bag = propagation . createBaggage ( {
111111 key : { value : 'value' } ,
112112 key1 : { value : 'value1' } ,
113113 } ) ;
@@ -125,11 +125,11 @@ describe('Baggage', () => {
125125
126126 describe ( 'context' , ( ) => {
127127 it ( 'should set and get a baggage from a context' , ( ) => {
128- const bag = createBaggage ( ) ;
128+ const bag = propagation . createBaggage ( ) ;
129129
130- const ctx = setBaggage ( ROOT_CONTEXT , bag ) ;
130+ const ctx = propagation . setBaggage ( ROOT_CONTEXT , bag ) ;
131131
132- assert . strictEqual ( bag , getBaggage ( ctx ) ) ;
132+ assert . strictEqual ( bag , propagation . getBaggage ( ctx ) ) ;
133133 } ) ;
134134 } ) ;
135135
@@ -148,7 +148,7 @@ describe('Baggage', () => {
148148 } ) ;
149149
150150 it ( 'should retain metadata' , ( ) => {
151- const bag = createBaggage ( {
151+ const bag = propagation . createBaggage ( {
152152 key : {
153153 value : 'value' ,
154154 metadata : baggageEntryMetadataFromString ( 'meta' ) ,
0 commit comments