import { formatToUnderscore } from './formatToUnderscore';

describe('formatToUnderscore', () => {
  it('converts spaces to underscores and lowercases the string', () => {
    expect(formatToUnderscore('Hello World')).toBe('hello_world');
    expect(formatToUnderscore('  Multiple   Spaces  ')).toBe('multiple_spaces');
    expect(formatToUnderscore('MiXeD CaSe Input')).toBe('mixed_case_input');
  });

  it('handles empty strings', () => {
    expect(formatToUnderscore('')).toBe('');
  });

   it('returns empty string if input is not a string', () => {
    expect(formatToUnderscore(123)).toBe('');
  });
});
