@@ -71,75 +71,79 @@ describe('updateInstancesDetail', async function () {
7171
7272 it ( 'adds appropriate status and name field to the instance' , async function ( ) {
7373 const actualResult = await client
74- . extractInstancesFromReservations ( intoCollection ( completeReservationsList ) , getStatus )
74+ . extractInstancesFromReservations ( intoCollection ( [ completeReservationsList ] ) , getStatus )
7575 . promise ( )
76- const expectedResult : PatchedReservation [ ] = [
77- {
78- Instances : [
79- {
80- InstanceId : 'running-1' ,
81- Name : 'name1' ,
82- Tags : [ { Key : 'Name' , Value : 'name1' } ] ,
83- LastSeenStatus : 'running' ,
84- } ,
85- {
86- InstanceId : 'stopped-2' ,
87- Name : 'name2' ,
88- Tags : [ { Key : 'Name' , Value : 'name2' } ] ,
89- LastSeenStatus : 'stopped' ,
90- } ,
91- ] ,
92- } ,
93- {
94- Instances : [
95- {
96- InstanceId : 'pending-3' ,
97- Tags : [ { Key : 'Name' , Value : 'name3' } ] ,
98- LastSeenStatus : 'pending' ,
99- Name : 'name3' ,
100- } ,
101- {
102- InstanceId : 'running-4' ,
103- Tags : [ { Key : 'Name' , Value : 'name4' } ] ,
104- Name : 'name4' ,
105- LastSeenStatus : 'running' ,
106- } ,
107- ] ,
108- } ,
76+ const expectedResult : PatchedReservation [ ] [ ] = [
77+ [
78+ {
79+ Instances : [
80+ {
81+ InstanceId : 'running-1' ,
82+ Name : 'name1' ,
83+ Tags : [ { Key : 'Name' , Value : 'name1' } ] ,
84+ LastSeenStatus : 'running' ,
85+ } ,
86+ {
87+ InstanceId : 'stopped-2' ,
88+ Name : 'name2' ,
89+ Tags : [ { Key : 'Name' , Value : 'name2' } ] ,
90+ LastSeenStatus : 'stopped' ,
91+ } ,
92+ ] ,
93+ } ,
94+ {
95+ Instances : [
96+ {
97+ InstanceId : 'pending-3' ,
98+ Tags : [ { Key : 'Name' , Value : 'name3' } ] ,
99+ LastSeenStatus : 'pending' ,
100+ Name : 'name3' ,
101+ } ,
102+ {
103+ InstanceId : 'running-4' ,
104+ Tags : [ { Key : 'Name' , Value : 'name4' } ] ,
105+ Name : 'name4' ,
106+ LastSeenStatus : 'running' ,
107+ } ,
108+ ] ,
109+ } ,
110+ ] ,
109111 ]
110112
111113 assert . deepStrictEqual ( actualResult , expectedResult )
112114 } )
113115
114116 it ( 'handles incomplete and missing tag fields' , async function ( ) {
115117 const actualResult = await client
116- . extractInstancesFromReservations ( intoCollection ( incompleteReservationsList ) , getStatus )
118+ . extractInstancesFromReservations ( intoCollection ( [ incompleteReservationsList ] ) , getStatus )
117119 . promise ( )
118120
119- const expectedResult : PatchedReservation [ ] = [
120- {
121- Instances : [
122- {
123- InstanceId : 'running-1' ,
124- LastSeenStatus : 'running' ,
125- } ,
126- {
127- InstanceId : 'stopped-2' ,
128- LastSeenStatus : 'stopped' ,
129- Tags : [ ] ,
130- } ,
131- ] ,
132- } ,
133- {
134- Instances : [
135- {
136- InstanceId : 'pending-3' ,
137- Tags : [ { Key : 'Name' , Value : 'name3' } ] ,
138- LastSeenStatus : 'pending' ,
139- Name : 'name3' ,
140- } ,
141- ] ,
142- } ,
121+ const expectedResult : PatchedReservation [ ] [ ] = [
122+ [
123+ {
124+ Instances : [
125+ {
126+ InstanceId : 'running-1' ,
127+ LastSeenStatus : 'running' ,
128+ } ,
129+ {
130+ InstanceId : 'stopped-2' ,
131+ LastSeenStatus : 'stopped' ,
132+ Tags : [ ] ,
133+ } ,
134+ ] ,
135+ } ,
136+ {
137+ Instances : [
138+ {
139+ InstanceId : 'pending-3' ,
140+ Tags : [ { Key : 'Name' , Value : 'name3' } ] ,
141+ LastSeenStatus : 'pending' ,
142+ Name : 'name3' ,
143+ } ,
144+ ] ,
145+ } ,
146+ ] ,
143147 ]
144148
145149 assert . deepStrictEqual ( actualResult , expectedResult )
0 commit comments