Skip to content

🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.

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

const parse = (input: string) => {
  if (!input) throw new Error('missing');
  if (input.includes('/')) throw new Error('invalid path');
  return input;
};

it('rejects a missing value', () => {
  expect(() => parse('')).toThrow('missing');
});

it('rejects a path', () => {
  expect(() => parse('a/b')).toThrow('invalid path');
});