import { describe, expect, it } from 'vitest';

import { isGitAuthErrorMessage } from './index.js';

describe('isGitAuthErrorMessage', () => {
  it('matches fine-grained GitHub invalid username or token errors', () => {
    expect(
      isGitAuthErrorMessage(new Error('remote: Invalid username or token. Password authentication is not supported for Git operations.'))
    ).toBe(true);
  });

  it('matches password authentication is not supported errors', () => {
    expect(isGitAuthErrorMessage(new Error('fatal: Password authentication is not supported for Git operations.'))).toBe(true);
  });
});
