File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
packages/data-connect/test Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -108,15 +108,16 @@ describe('DataConnect Tests', async () => {
108108 } ) ;
109109 it ( `instantly executes a query if one hasn't been subscribed to` , async ( ) => {
110110 const taskListQuery = getPostsRef ( ) ;
111+ let unsubscribe : null | ( ( ) => void ) = null ;
111112 const promise = new Promise < QueryResult < PostListResponse , PostVariables > > (
112113 ( resolve , reject ) => {
113- const unsubscribe = subscribe ( taskListQuery , {
114+ unsubscribe = subscribe ( taskListQuery , {
114115 onNext : res => {
115- unsubscribe ( ) ;
116+ unsubscribe ?. ( ) ;
116117 resolve ( res ) ;
117118 } ,
118119 onErr : ( ) => {
119- unsubscribe ( ) ;
120+ unsubscribe ?. ( ) ;
120121 reject ( res ) ;
121122 }
122123 } ) ;
@@ -132,7 +133,7 @@ describe('DataConnect Tests', async () => {
132133 const taskListQuery = getPostsRef ( ) ;
133134 const queryResult = await executeQuery ( taskListQuery ) ;
134135 const result = await waitForFirstEvent ( taskListQuery ) ;
135- expect ( result . data ) . to . eq ( queryResult . data ) ;
136+ expect ( result . data ) . to . deep . eq ( queryResult . data ) ;
136137 expect ( result . source ) . to . eq ( SOURCE_CACHE ) ;
137138 } ) ;
138139 it ( `returns the proper JSON when calling .toJSON()` , async ( ) => {
You can’t perform that action at this time.
0 commit comments