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。

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

import { extractIpcError } from '../utils/ipcError';

describe('extractIpcError · saved-account errors', () => {
  it.each(['ACCOUNT_REAUTH_REQUIRED', 'REGION_MISMATCH', 'CREDENTIAL_STORE_UNAVAILABLE'] as const)(
    'decodes %s after Electron wraps the main-process error',
    (code) => {
      expect(
        extractIpcError(
          new Error(`Error invoking remote method 'auth:accounts:switch': Error: [${code}] failed`),
        ),
      ).toEqual({ code, message: 'failed' });
    },
  );
});