@@ -76,7 +76,7 @@ describe.each([
7676 } ,
7777 } ) ;
7878 const users : DenormalizeNullable < typeof sortedUsers > | symbol =
79- new MemoCache ( ) . query ( sortedUsers , [ ] , state ) ;
79+ new MemoCache ( ) . query ( sortedUsers , [ ] , state ) . data ;
8080 expect ( users ) . not . toEqual ( expect . any ( Symbol ) ) ;
8181 if ( typeof users === 'symbol' ) return ;
8282 expect ( users && users [ 0 ] . name ) . toBe ( 'Zeta' ) ;
@@ -101,7 +101,7 @@ describe.each([
101101 } ,
102102 } ) ;
103103 expect (
104- new MemoCache ( ) . query ( sortedUsers , [ { asc : true } ] , state ) ,
104+ new MemoCache ( ) . query ( sortedUsers , [ { asc : true } ] , state ) . data ,
105105 ) . toMatchSnapshot ( ) ;
106106 } ) ;
107107
@@ -115,9 +115,9 @@ describe.each([
115115 } ,
116116 } ,
117117 } ;
118- const data = new MemoCache ( ) . query ( sortedUsers , [ ] , state ) ;
118+ const { data } = new MemoCache ( ) . query ( sortedUsers , [ ] , state ) ;
119119
120- expect ( createOutput ( data ) ) . toEqual ( undefined ) ;
120+ expect ( createOutput ( data ) ) . not . toEqual ( expect . any ( Array ) ) ;
121121 } ) ;
122122
123123 test ( 'denormalize aggregates' , ( ) => {
@@ -152,7 +152,7 @@ describe.each([
152152 } ) ;
153153 const totalCount :
154154 | DenormalizeNullable < typeof userCountByAdmin >
155- | symbol = new MemoCache ( ) . query ( userCountByAdmin , [ ] , state ) ;
155+ | symbol = new MemoCache ( ) . query ( userCountByAdmin , [ ] , state ) . data ;
156156
157157 expect ( totalCount ) . toBe ( 4 ) ;
158158 const nonAdminCount :
@@ -161,15 +161,15 @@ describe.each([
161161 userCountByAdmin ,
162162 [ { isAdmin : false } ] ,
163163 state ,
164- ) ;
164+ ) . data ;
165165 expect ( nonAdminCount ) . toBe ( 3 ) ;
166166 const adminCount :
167167 | DenormalizeNullable < typeof userCountByAdmin >
168168 | symbol = new MemoCache ( ) . query (
169169 userCountByAdmin ,
170170 [ { isAdmin : true } ] ,
171171 state ,
172- ) ;
172+ ) . data ;
173173 expect ( adminCount ) . toBe ( 1 ) ;
174174 if ( typeof totalCount === 'symbol' ) return ;
175175
@@ -209,7 +209,7 @@ describe('top level schema', () => {
209209 } ,
210210 } ,
211211 } ;
212- const users = new MemoCache ( ) . query ( sortedUsers , [ ] , state ) ;
212+ const users = new MemoCache ( ) . query ( sortedUsers , [ ] , state ) . data ;
213213 expect ( users ) . not . toEqual ( expect . any ( Symbol ) ) ;
214214 if ( typeof users === 'symbol' ) return ;
215215 expect ( users && users [ 0 ] . name ) . toBe ( 'Zeta' ) ;
@@ -228,7 +228,7 @@ describe('top level schema', () => {
228228 } ,
229229 } ,
230230 } ;
231- const users = new MemoCache ( ) . query ( sortedUsers , [ ] , state ) ;
231+ const users = new MemoCache ( ) . query ( sortedUsers , [ ] , state ) . data ;
232232 expect ( users ) . toBeUndefined ( ) ;
233233 } ) ;
234234
@@ -243,8 +243,8 @@ describe('top level schema', () => {
243243 return sorted . reverse ( ) ;
244244 } ,
245245 ) ;
246- const users = new MemoCache ( ) . query ( allSortedUsers , [ ] , initialState ) ;
247- expect ( users ) . toBeUndefined ( ) ;
246+ const users = new MemoCache ( ) . query ( allSortedUsers , [ ] , initialState ) . data ;
247+ expect ( users ) . toEqual ( expect . any ( Symbol ) ) ;
248248 } ) ;
249249
250250 test ( 'works with nested schemas' , ( ) => {
@@ -258,8 +258,8 @@ describe('top level schema', () => {
258258 return sorted . reverse ( ) ;
259259 } ,
260260 ) ;
261- const users = new MemoCache ( ) . query ( allSortedUsers , [ ] , initialState ) ;
262- expect ( users ) . toBeUndefined ( ) ;
261+ const users = new MemoCache ( ) . query ( allSortedUsers , [ ] , initialState ) . data ;
262+ expect ( users ) . toEqual ( expect . any ( Symbol ) ) ;
263263 } ) ;
264264
265265 test ( 'denormalizes should not be found when no entities are present' , ( ) => {
@@ -273,7 +273,7 @@ describe('top level schema', () => {
273273 } ,
274274 } ;
275275
276- const value = new MemoCache ( ) . query ( sortedUsers , [ ] , state ) ;
276+ const value = new MemoCache ( ) . query ( sortedUsers , [ ] , state ) . data ;
277277
278278 expect ( value ) . toEqual ( undefined ) ;
279279 } ) ;
0 commit comments