Skip to content

Commit 9e8721b

Browse files
committed
fix: unit tests
1 parent a2dac5c commit 9e8721b

1 file changed

Lines changed: 8 additions & 31 deletions

File tree

src/query.test.ts

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1310,9 +1310,9 @@ describe('Query', () => {
13101310
return curr;
13111311
});
13121312

1313-
expect(reactionSpy).toHaveBeenCalledTimes(2);
1313+
expect(reactionSpy).toHaveBeenCalledTimes(1);
13141314
expect(reactionSpy).toHaveBeenNthCalledWith(
1315-
2,
1315+
1,
13161316
{
13171317
a: {
13181318
b: {
@@ -1337,25 +1337,7 @@ describe('Query', () => {
13371337
},
13381338
},
13391339
},
1340-
{
1341-
a: {
1342-
b: {
1343-
c: {
1344-
d: {
1345-
e: {
1346-
children: [
1347-
{
1348-
id: '1',
1349-
name: 'John',
1350-
age: 20,
1351-
},
1352-
],
1353-
},
1354-
},
1355-
},
1356-
},
1357-
},
1358-
},
1340+
undefined,
13591341
);
13601342

13611343
query.destroy();
@@ -1495,20 +1477,15 @@ describe('Query', () => {
14951477
return curr;
14961478
});
14971479

1498-
expect(reactionFooSpy).toHaveBeenCalledTimes(2);
1499-
1480+
expect(reactionFooSpy).toHaveBeenCalledTimes(1);
15001481
expect(reactionFooSpy).toHaveBeenNthCalledWith(
1501-
2,
1482+
1,
15021483
{
15031484
age: 20,
15041485
id: '1',
15051486
name: 'Doe',
15061487
},
1507-
{
1508-
age: 20,
1509-
id: '1',
1510-
name: 'John',
1511-
},
1488+
null,
15121489
);
15131490

15141491
testClass.destroy();
@@ -4583,12 +4560,12 @@ describe('Query', () => {
45834560

45844561
expect(onError).toHaveBeenNthCalledWith(
45854562
1,
4586-
expect.objectContaining({ message: 'boom-1' }),
4563+
expect.objectContaining({ message: 'transformed:boom-1' }),
45874564
undefined,
45884565
);
45894566
expect(onError).toHaveBeenNthCalledWith(
45904567
2,
4591-
expect.objectContaining({ message: 'boom-2' }),
4568+
expect.objectContaining({ message: 'transformed:boom-2' }),
45924569
undefined,
45934570
);
45944571
expect(onError).toHaveBeenCalledTimes(2);

0 commit comments

Comments
 (0)