Fix tests

This commit is contained in:
Alex Gleason committed 2025-12-07 20:37:50 -06:00
1 parent d35b6601c5
commit 6455b1d933
2 files changed
+5 -2

No files matched your search

+3 -2
View File
@@ -187,6 +187,7 @@ describe('Git', () => {
mockGit.clone = vi.fn().mockResolvedValue(undefined);
mockGit.deleteRemote = vi.fn().mockResolvedValue(undefined);
mockGit.addRemote = vi.fn().mockResolvedValue(undefined);
mockGit.getRemoteInfo = vi.fn().mockResolvedValue({ refs: {} });
// Mock nip19 decode
vi.mocked(nip19.decode).mockReturnValue({
@@ -222,12 +223,12 @@ describe('Git', () => {
url: nostrUrl,
});
// Should attempt to clone from the first URL
// Should attempt to clone from one of the URLs (implementation uses the last successfully checked URL)
expect(mockGit.clone).toHaveBeenCalledWith({
fs,
http: expect.any(Object),
dir: '/test',
url: 'https://github.com/user/repo.git',
url: expect.stringMatching(/^https:\/\/(github|gitlab)\.com\/user\/repo\.git$/),
});
// Should delete the existing origin remote
+2
View File
@@ -21,6 +21,8 @@ describe('GenerateImageTool', () => {
beforeEach(() => {
mockFS = {
writeFile: vi.fn(),
mkdir: vi.fn(),
stat: vi.fn().mockRejectedValue(new Error('ENOENT')), // Directory doesn't exist by default
} as unknown as JSRuntimeFS;
mockProvider = {