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。

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

import { PI_IMAGE_INPUT_UNSUPPORTED_MARKER, isPiImageInputUnsupportedError } from '../inputError';

describe('isPiImageInputUnsupportedError', () => {
  it('recognizes both the structured code and the wire-safe marker', () => {
    expect(
      isPiImageInputUnsupportedError(
        Object.assign(new Error('disabled'), { code: 'PI_IMAGE_INPUT_UNSUPPORTED' }),
      ),
    ).toBe(true);
    expect(isPiImageInputUnsupportedError(`${PI_IMAGE_INPUT_UNSUPPORTED_MARKER} disabled`)).toBe(
      true,
    );
  });

  it('does not classify unrelated image errors', () => {
    expect(isPiImageInputUnsupportedError('image omitted: model does not support images')).toBe(
      false,
    );
  });
});