import { test, describe } from 'node:test'; import assert from 'node:assert'; import { getProjectName } from '../utils/git.js'; describe('Git utilities', () => { test('getProjectName should return directory name as fallback', async () => { // This test will use the fallback since we're not in a git repo with GitHub remote const projectName = await getProjectName(); // Should return some string (either from git remote or directory name) assert.strictEqual(typeof projectName, 'string'); assert.ok(projectName.length > 0, 'Project name should not be empty'); }); test('getProjectName should handle errors gracefully', async () => { // Test that it doesn't throw even if git operations fail const projectName = await getProjectName(); assert.strictEqual(typeof projectName, 'string'); assert.ok(projectName.length > 0); }); });