Skip to content

Commit b68c9d0

Browse files
davidmartos96simolus3
authored andcommitted
send data as a JSON String to fix tests
1 parent e39c9d7 commit b68c9d0

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

packages/powersync_core/test/in_memory_sync_test.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'dart:async';
2+
import 'dart:convert';
23

34
import 'package:async/async.dart';
45
import 'package:logging/logging.dart';
@@ -176,7 +177,7 @@ void _declareTests(String name, SyncOptions options) {
176177
'object_type': 'a',
177178
'object_id': '1',
178179
'checksum': 0,
179-
'data': {},
180+
'data': '{}',
180181
}
181182
],
182183
}
@@ -191,7 +192,7 @@ void _declareTests(String name, SyncOptions options) {
191192
'object_type': 'b',
192193
'object_id': '1',
193194
'checksum': 0,
194-
'data': {},
195+
'data': '{}',
195196
}
196197
],
197198
}
@@ -233,7 +234,7 @@ void _declareTests(String name, SyncOptions options) {
233234
'data': [
234235
{
235236
'checksum': priority + 10,
236-
'data': {'name': 'test', 'email': 'email'},
237+
'data': json.encode({'name': 'test', 'email': 'email'}),
237238
'op': 'PUT',
238239
'op_id': '${operationId++}',
239240
'object_id': 'prio$priority',
@@ -415,15 +416,15 @@ void _declareTests(String name, SyncOptions options) {
415416
'data': [
416417
{
417418
'checksum': 0,
418-
'data': {'name': 'from local', 'email': '[email protected]'},
419+
'data': json.encode({'name': 'from local', 'email': '[email protected]'}),
419420
'op': 'PUT',
420421
'op_id': '1',
421422
'object_id': '1',
422423
'object_type': 'customers'
423424
},
424425
{
425426
'checksum': 0,
426-
'data': {'name': 'additional', 'email': ''},
427+
'data': json.encode({'name': 'additional', 'email': ''}),
427428
'op': 'PUT',
428429
'op_id': '2',
429430
'object_id': '2',
@@ -481,7 +482,7 @@ void _declareTests(String name, SyncOptions options) {
481482
'object_type': bucket,
482483
'object_id': '$lastOpId',
483484
'checksum': 0,
484-
'data': {},
485+
'data': '{}',
485486
}
486487
],
487488
}

0 commit comments

Comments
 (0)