From 75a2f1c1e870657b86a985404d92ee53cf9325dc Mon Sep 17 00:00:00 2001 From: tamaina Date: Sat, 9 Mar 2024 12:27:52 +0000 Subject: [PATCH] fix type error --- packages/backend/test/unit/ap-request.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/backend/test/unit/ap-request.ts b/packages/backend/test/unit/ap-request.ts index 8406cb7ec2..50894c8b81 100644 --- a/packages/backend/test/unit/ap-request.ts +++ b/packages/backend/test/unit/ap-request.ts @@ -48,8 +48,8 @@ describe('ap-request post', () => { const parsed = parseRequestSignature(req.request); expect(parsed.version).toBe('draft'); - if (!parsed) return; - const verify = await verifyDraftSignature(parsed.value, keypair.publicKey); + expect(Array.isArray(parsed.value)).toBe(false); + const verify = await verifyDraftSignature(parsed.value as any, keypair.publicKey); assert.deepStrictEqual(verify, true); }); test('imported', async () => { @@ -60,8 +60,8 @@ describe('ap-request post', () => { const parsed = parseRequestSignature(req.request); expect(parsed.version).toBe('draft'); - if (!parsed) return; - const verify = await verifyDraftSignature(parsed.value, keypair.publicKey); + expect(Array.isArray(parsed.value)).toBe(false); + const verify = await verifyDraftSignature(parsed.value as any, keypair.publicKey); assert.deepStrictEqual(verify, true); }); }); @@ -81,8 +81,8 @@ describe('ap-request get', () => { const parsed = parseRequestSignature(req.request); expect(parsed.version).toBe('draft'); - if (!parsed) return; - const verify = await verifyDraftSignature(parsed.value, keypair.publicKey); + expect(Array.isArray(parsed.value)).toBe(false); + const verify = await verifyDraftSignature(parsed.value as any, keypair.publicKey); assert.deepStrictEqual(verify, true); }); });