From ef8e3c371ad13524a10d48a6ae6c535110ef5ed1 Mon Sep 17 00:00:00 2001 From: lenkan Date: Tue, 3 Sep 2024 15:04:53 +0200 Subject: [PATCH] fix test --- examples/integration-scripts/challenge.test.ts | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/examples/integration-scripts/challenge.test.ts b/examples/integration-scripts/challenge.test.ts index 0f8d1217..8eb1bb8d 100644 --- a/examples/integration-scripts/challenge.test.ts +++ b/examples/integration-scripts/challenge.test.ts @@ -97,11 +97,9 @@ test('challenge', async () => { // List Client 1 contacts let contacts1 = await client1.contacts().list(); - let bobContact = contacts1.find( - (contact: { alias: string }) => contact.alias === 'bob' - ); - expect(bobContact.alias).toEqual('bob'); - expect(bobContact.challenges).toHaveLength(0); + let bobContact = contacts1.find((contact) => contact.alias === 'bob'); + expect(bobContact?.alias).toEqual('bob'); + expect(bobContact?.challenges).toHaveLength(0); // Bob responds to Alice challenge await client2.challenges().respond('bob', aid1.i, challenge1_small.words); @@ -125,10 +123,9 @@ test('challenge', async () => { // Check Bob's challenge in conctats contacts1 = await client1.contacts().list(); - bobContact = contacts1.find( - (contact: { alias: string }) => contact.alias === 'bob' - ); - expect(bobContact.challenges[0].authenticated).toEqual(true); + bobContact = contacts1.find((contact) => contact.alias === 'bob'); + + expect(bobContact?.challenges).toEqual([{ authenticated: true }]); await assertOperations(client1, client2); }, 30000);