chore(lint): burn down remaining warnings to zero
This commit is contained in:
@@ -87,7 +87,7 @@ describe('MatrixAdapter', () => {
|
||||
|
||||
it('send delivers a message via PUT', async () => {
|
||||
let syncStarted = false;
|
||||
mockFetch.mockImplementation(async (url: string, init?: any) => {
|
||||
mockFetch.mockImplementation(async (url: string, init?: RequestInit) => {
|
||||
if (url.endsWith('/_matrix/client/v3/account/whoami')) {
|
||||
return jsonResponse({ user_id: '@flynn:example.org' });
|
||||
}
|
||||
@@ -99,7 +99,7 @@ describe('MatrixAdapter', () => {
|
||||
return new Promise<Response>(() => {});
|
||||
}
|
||||
if (init?.method === 'PUT' && url.includes('/send/m.room.message/')) {
|
||||
const body = JSON.parse(init.body);
|
||||
const body = JSON.parse(String(init?.body ?? '{}'));
|
||||
expect(body.msgtype).toBe('m.text');
|
||||
expect(body.body).toBe('Hello there');
|
||||
return jsonResponse({ event_id: '$sent1' });
|
||||
|
||||
@@ -201,8 +201,10 @@ export class MatrixAdapter implements ChannelAdapter {
|
||||
return;
|
||||
}
|
||||
|
||||
const err = error as any;
|
||||
if (err && typeof err === 'object' && err.name === 'AbortError') {
|
||||
const errName = error && typeof error === 'object' && 'name' in error
|
||||
? String((error as { name?: unknown }).name)
|
||||
: '';
|
||||
if (errName === 'AbortError') {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user