Skip to content

armgit / cindy

Public Imported from GitHub
0

Consider it done. The open-source AI agent that works out of the box · 想到,就能做到。开源、开箱即用的 AI Agent。

662 B
Raw Blame
import { describe, expect, it } from 'vitest';

import { isMicrophonePermissionDeniedError } from '../WebMicAudioEngine';

describe('WebMicAudioEngine error classification', () => {
  it('recognizes microphone permission revocation errors structurally', () => {
    expect(isMicrophonePermissionDeniedError(new DOMException('denied', 'NotAllowedError'))).toBe(true);
    expect(isMicrophonePermissionDeniedError({ name: 'SecurityError', message: 'blocked' })).toBe(true);
    expect(isMicrophonePermissionDeniedError({ name: 'NotReadableError' })).toBe(false);
    expect(isMicrophonePermissionDeniedError(new Error('permission denied'))).toBe(false);
  });
});