Skip to content

Commit 01684dc

Browse files
davidmartos96simolus3
authored andcommitted
send data as a JSON String to fix tests
1 parent d104fd2 commit 01684dc

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';
@@ -172,7 +173,7 @@ void _declareTests(String name, SyncOptions options) {
172173
'object_type': 'a',
173174
'object_id': '1',
174175
'checksum': 0,
175-
'data': {},
176+
'data': '{}',
176177
}
177178
],
178179
}
@@ -187,7 +188,7 @@ void _declareTests(String name, SyncOptions options) {
187188
'object_type': 'b',
188189
'object_id': '1',
189190
'checksum': 0,
190-
'data': {},
191+
'data': '{}',
191192
}
192193
],
193194
}
@@ -229,7 +230,7 @@ void _declareTests(String name, SyncOptions options) {
229230
'data': [
230231
{
231232
'checksum': priority + 10,
232-
'data': {'name': 'test', 'email': 'email'},
233+
'data': json.encode({'name': 'test', 'email': 'email'}),
233234
'op': 'PUT',
234235
'op_id': '${operationId++}',
235236
'object_id': 'prio$priority',
@@ -411,15 +412,15 @@ void _declareTests(String name, SyncOptions options) {
411412
'data': [
412413
{
413414
'checksum': 0,
414-
'data': {'name': 'from local', 'email': '[email protected]'},
415+
'data': json.encode({'name': 'from local', 'email': '[email protected]'}),
415416
'op': 'PUT',
416417
'op_id': '1',
417418
'object_id': '1',
418419
'object_type': 'customers'
419420
},
420421
{
421422
'checksum': 0,
422-
'data': {'name': 'additional', 'email': ''},
423+
'data': json.encode({'name': 'additional', 'email': ''}),
423424
'op': 'PUT',
424425
'op_id': '2',
425426
'object_id': '2',
@@ -477,7 +478,7 @@ void _declareTests(String name, SyncOptions options) {
477478
'object_type': bucket,
478479
'object_id': '$lastOpId',
479480
'checksum': 0,
480-
'data': {},
481+
'data': '{}',
481482
}
482483
],
483484
}

0 commit comments

Comments
 (0)