@@ -49,7 +49,7 @@ describe('EntityManager', () => {
4949 it ( 'save using connection.manager' , async ( ) => {
5050 const options = defaultOptions ;
5151 const connection = await typeorm . createConnection ( defaultOptions ) ;
52- const user = new User ( 1 , 'aspecto ' , 'io' ) ;
52+ const user = new User ( 1 , 'opentelemetry ' , 'io' ) ;
5353 await connection . manager . save ( user ) ;
5454 const typeOrmSpans = getTestSpans ( ) ;
5555
@@ -64,14 +64,14 @@ describe('EntityManager', () => {
6464 attributes [ ATTR_DB_QUERY_TEXT ] ,
6565 JSON . stringify ( { targetOrEntity : user } )
6666 ) ;
67- await connection . close ( ) ;
67+ await connection . destroy ( ) ;
6868 } ) ;
6969
7070 it ( 'save' , async ( ) => {
7171 const options = defaultOptions ;
7272 const connection = await typeorm . createConnection ( defaultOptions ) ;
7373 const manager = connection . createEntityManager ( ) ;
74- const user = new User ( 1 , 'aspecto ' , 'io' ) ;
74+ const user = new User ( 1 , 'opentelemetry ' , 'io' ) ;
7575 await manager . save ( user ) ;
7676 const typeOrmSpans = getTestSpans ( ) ;
7777
@@ -86,15 +86,15 @@ describe('EntityManager', () => {
8686 attributes [ ATTR_DB_QUERY_TEXT ] ,
8787 JSON . stringify ( { targetOrEntity : user } )
8888 ) ;
89- await connection . close ( ) ;
89+ await connection . destroy ( ) ;
9090 } ) ;
9191
9292 it ( 'remove' , async ( ) => {
9393 const options = defaultOptions ;
9494 const connection = await typeorm . createConnection ( defaultOptions ) ;
9595 const manager = connection . createEntityManager ( ) ;
9696
97- const user = new User ( 56 , 'aspecto ' , 'io' ) ;
97+ const user = new User ( 56 , 'opentelemetry ' , 'io' ) ;
9898 await manager . save ( user ) ;
9999 await manager . remove ( user ) ;
100100 const typeOrmSpans = getTestSpans ( ) ;
@@ -109,17 +109,21 @@ describe('EntityManager', () => {
109109 assert . strictEqual (
110110 attributes [ ATTR_DB_QUERY_TEXT ] ,
111111 JSON . stringify ( {
112- targetOrEntity : { id : 56 , firstName : 'aspecto' , lastName : 'io' } ,
112+ targetOrEntity : {
113+ id : 56 ,
114+ firstName : 'opentelemetry' ,
115+ lastName : 'io' ,
116+ } ,
113117 } )
114118 ) ;
115- await connection . close ( ) ;
119+ await connection . destroy ( ) ;
116120 } ) ;
117121
118122 it ( 'update' , async ( ) => {
119123 const options = defaultOptions ;
120124 const connection = await typeorm . createConnection ( defaultOptions ) ;
121125 const manager = connection . createEntityManager ( ) ;
122- const user = new User ( 56 , 'aspecto ' , 'io' ) ;
126+ const user = new User ( 56 , 'opentelemetry ' , 'io' ) ;
123127 await manager . save ( user ) ;
124128 const partialEntity = { lastName : '.io' } ;
125129 await manager . update ( User , 56 , partialEntity ) ;
@@ -136,7 +140,7 @@ describe('EntityManager', () => {
136140 attributes [ ATTR_DB_QUERY_TEXT ] ,
137141 JSON . stringify ( { target : 'User' , criteria : 56 , partialEntity } )
138142 ) ;
139- await connection . close ( ) ;
143+ await connection . destroy ( ) ;
140144 } ) ;
141145
142146 it ( 'Sets failure status when function throws' , async ( ) => {
@@ -153,7 +157,7 @@ describe('EntityManager', () => {
153157 typeOrmSpans [ 0 ] . status . message ,
154158 'No metadata for "[object Object]" was found.'
155159 ) ;
156- await connection . close ( ) ;
160+ await connection . destroy ( ) ;
157161 } ) ;
158162 } ) ;
159163
@@ -174,7 +178,7 @@ describe('EntityManager', () => {
174178 const manager1 = sqlite1 . createEntityManager ( ) ;
175179 const manager2 = sqlite2 . createEntityManager ( ) ;
176180
177- const user = new User ( 1 , 'aspecto ' , 'io' ) ;
181+ const user = new User ( 1 , 'opentelemetry ' , 'io' ) ;
178182 await manager1 . save ( user ) ;
179183 await manager2 . remove ( user ) ;
180184
@@ -216,8 +220,8 @@ describe('EntityManager', () => {
216220 sqlite2Span . attributes [ ATTR_DB_COLLECTION_NAME ] ,
217221 'user'
218222 ) ;
219- await sqlite1 . close ( ) ;
220- await sqlite2 . close ( ) ;
223+ await sqlite1 . destroy ( ) ;
224+ await sqlite2 . destroy ( ) ;
221225 } ) ;
222226 } ) ;
223227} ) ;
0 commit comments