fix type error

This commit is contained in:
tamaina 2024-03-09 12:27:52 +00:00
parent d0da9f32dc
commit 75a2f1c1e8

View File

@ -48,8 +48,8 @@ describe('ap-request post', () => {
const parsed = parseRequestSignature(req.request); const parsed = parseRequestSignature(req.request);
expect(parsed.version).toBe('draft'); expect(parsed.version).toBe('draft');
if (!parsed) return; expect(Array.isArray(parsed.value)).toBe(false);
const verify = await verifyDraftSignature(parsed.value, keypair.publicKey); const verify = await verifyDraftSignature(parsed.value as any, keypair.publicKey);
assert.deepStrictEqual(verify, true); assert.deepStrictEqual(verify, true);
}); });
test('imported', async () => { test('imported', async () => {
@ -60,8 +60,8 @@ describe('ap-request post', () => {
const parsed = parseRequestSignature(req.request); const parsed = parseRequestSignature(req.request);
expect(parsed.version).toBe('draft'); expect(parsed.version).toBe('draft');
if (!parsed) return; expect(Array.isArray(parsed.value)).toBe(false);
const verify = await verifyDraftSignature(parsed.value, keypair.publicKey); const verify = await verifyDraftSignature(parsed.value as any, keypair.publicKey);
assert.deepStrictEqual(verify, true); assert.deepStrictEqual(verify, true);
}); });
}); });
@ -81,8 +81,8 @@ describe('ap-request get', () => {
const parsed = parseRequestSignature(req.request); const parsed = parseRequestSignature(req.request);
expect(parsed.version).toBe('draft'); expect(parsed.version).toBe('draft');
if (!parsed) return; expect(Array.isArray(parsed.value)).toBe(false);
const verify = await verifyDraftSignature(parsed.value, keypair.publicKey); const verify = await verifyDraftSignature(parsed.value as any, keypair.publicKey);
assert.deepStrictEqual(verify, true); assert.deepStrictEqual(verify, true);
}); });
}); });