@@ -62,19 +62,17 @@ test("parse to json following ColumnInfo", async () => {
6262
6363 const res1 = await resultGen . next ( ) ;
6464
65- expect ( res1 . value ) . toEqual ( [
66- {
67- name : "test-name-1" ,
68- disabled : true ,
69- timestamp : 1669718600001n ,
70- score1 : 101 ,
71- score2 : 102 ,
72- score3 : 103 ,
73- score4 : 104 ,
74- rate1 : 1.01 ,
75- rate2 : 1.02 ,
76- } ,
77- ] ) ;
65+ expect ( res1 . value ) . toEqual ( {
66+ name : "test-name-1" ,
67+ disabled : true ,
68+ timestamp : 1669718600001n ,
69+ score1 : 101 ,
70+ score2 : 102 ,
71+ score3 : 103 ,
72+ score4 : 104 ,
73+ rate1 : 1.01 ,
74+ rate2 : 1.02 ,
75+ } ) ;
7876} ) ;
7977
8078test ( "wait query completed" , async ( ) => {
@@ -91,10 +89,7 @@ test("wait query completed", async () => {
9189 ResultSetMetadata : {
9290 ColumnInfo : [ { Name : "name" , Type : "varchar" } ] ,
9391 } ,
94- Rows : [
95- { Data : [ { VarCharValue : "test-name-1" } ] } ,
96- { Data : [ { VarCharValue : "test-name-2" } ] } ,
97- ] ,
92+ Rows : [ { Data : [ { VarCharValue : "test-name-1" } ] } ] ,
9893 } ,
9994 } ) ;
10095
@@ -103,10 +98,7 @@ test("wait query completed", async () => {
10398 const res1 = await resultGen . next ( ) ;
10499
105100 expect ( res1 . done ) . toBe ( false ) ;
106- expect ( res1 . value ) . toEqual ( [
107- { name : "test-name-1" } ,
108- { name : "test-name-2" } ,
109- ] ) ;
101+ expect ( res1 . value ) . toEqual ( { name : "test-name-1" } ) ;
110102} ) ;
111103
112104test ( "get items with generator" , async ( ) => {
@@ -141,18 +133,19 @@ test("get items with generator", async () => {
141133
142134 const res1 = await queryResultGen . next ( ) ;
143135 expect ( res1 . done ) . toBe ( false ) ;
144- expect ( res1 . value ) . toEqual ( [
145- { name : "test-name-1" } ,
146- { name : "test-name-2" } ,
147- ] ) ;
136+ expect ( res1 . value ) . toEqual ( { name : "test-name-1" } ) ;
148137
149138 const res2 = await queryResultGen . next ( ) ;
150139 expect ( res2 . done ) . toBe ( false ) ;
151- expect ( res2 . value ) . toEqual ( [ { name : "test-name-3 " } ] ) ;
140+ expect ( res2 . value ) . toEqual ( { name : "test-name-2 " } ) ;
152141
153142 const res3 = await queryResultGen . next ( ) ;
154- expect ( res3 . done ) . toBe ( true ) ;
155- expect ( res3 . value ) . toBe ( undefined ) ;
143+ expect ( res3 . done ) . toBe ( false ) ;
144+ expect ( res3 . value ) . toEqual ( { name : "test-name-3" } ) ;
145+
146+ const res4 = await queryResultGen . next ( ) ;
147+ expect ( res4 . done ) . toBe ( true ) ;
148+ expect ( res4 . value ) . toBe ( undefined ) ;
156149} ) ;
157150
158151test ( "get all item with generator" , async ( ) => {
@@ -197,8 +190,8 @@ test("get all item with generator", async () => {
197190
198191 const allItems = [ ] ;
199192
200- for await ( const items of athenaQuery . query ( "" ) ) {
201- allItems . push ( ... items ) ;
193+ for await ( const item of athenaQuery . query ( "" ) ) {
194+ allItems . push ( item ) ;
202195 }
203196
204197 expect ( allItems ) . toEqual ( [
0 commit comments