chore: enforce lint across codebase and ban "maybe" in identifiers
Remove member-ordering and complexity eslint-disable comments by reordering class members and applying targeted fixes. Add metoyou/no-maybe-in-naming, type-safe WebRTC e2e harness helpers, and resolve remaining lint errors so npm run lint exits cleanly. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -62,7 +62,9 @@ describe('broadcastToServer', () => {
|
||||
expect((connA2.ws as WebSocket & { sentMessages: string[] }).sentMessages).toHaveLength(1);
|
||||
expect((connB.ws as WebSocket & { sentMessages: string[] }).sentMessages).toHaveLength(1);
|
||||
expect(connectedUsers.get('conn-a1')?.ws).toBeDefined();
|
||||
expect((connectedUsers.get('conn-a1')!.ws as WebSocket & { sentMessages: string[] }).sentMessages).toHaveLength(0);
|
||||
const connA1Passive = connectedUsers.get('conn-a1')?.ws as WebSocket & { sentMessages: string[] } | undefined;
|
||||
|
||||
expect(connA1Passive?.sentMessages).toHaveLength(0);
|
||||
});
|
||||
|
||||
it('excludes every connection for an identity when excludeIdentityOderId is set', () => {
|
||||
|
||||
@@ -94,12 +94,13 @@ describe('server websocket handler - multi-client sessions', () => {
|
||||
});
|
||||
|
||||
it('relays voice_state to other connections for the same user', async () => {
|
||||
const sender = createConnectedUser('conn-a1', {
|
||||
createConnectedUser('conn-a1', {
|
||||
authenticated: true,
|
||||
oderId: 'user-1',
|
||||
serverIds: new Set(['server-1']),
|
||||
clientInstanceId: 'device-a'
|
||||
});
|
||||
|
||||
const passive = createConnectedUser('conn-a2', {
|
||||
authenticated: true,
|
||||
oderId: 'user-1',
|
||||
@@ -129,7 +130,7 @@ describe('server websocket handler - multi-client sessions', () => {
|
||||
});
|
||||
|
||||
it('forwards RTC offers to the voice-active connection for the target user', async () => {
|
||||
const sender = createConnectedUser('conn-sender', {
|
||||
createConnectedUser('conn-sender', {
|
||||
authenticated: true,
|
||||
oderId: 'user-2',
|
||||
serverIds: new Set(['server-1'])
|
||||
@@ -228,6 +229,7 @@ describe('server websocket handler - multi-client sessions', () => {
|
||||
serverIds: new Set(['server-1']),
|
||||
clientInstanceId: 'device-a'
|
||||
});
|
||||
|
||||
const receiver = createConnectedUser('conn-a2', {
|
||||
authenticated: true,
|
||||
oderId: 'user-1',
|
||||
|
||||
Reference in New Issue
Block a user