Skip to content

Commit c64dec9

Browse files
committed
applied suggested changes
1 parent ee35369 commit c64dec9

File tree

3 files changed

+6
-18
lines changed

3 files changed

+6
-18
lines changed

src/core/server/tools/retrieve.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { z } from 'zod';
22
import { StorachaClient } from '../../storage/client.js';
33
import { StorageConfig } from 'src/core/storage/types.js';
4-
import { isValidCID } from 'src/core/storage/utils.js';
54

65
type RetrieveInput = {
76
filepath: string;

test/integration/stdio-mcp-server.test.ts

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ const isCI = process.env.CI === 'true';
115115
// Parse upload response
116116
const uploadResult = JSON.parse(uploadContent.text);
117117
expect(uploadResult).toHaveProperty('root');
118-
<<<<<<< HEAD
119118
// The root can be either a string or an object with toString method
120119
expect(uploadResult.root).toBeDefined();
121120
expect(uploadResult).toHaveProperty('url');
@@ -132,16 +131,14 @@ const isCI = process.env.CI === 'true';
132131
// Check the first file entry (could be in different formats depending on serialization)
133132
const firstFile = fileEntries[0];
134133
expect(firstFile).toBeDefined();
135-
=======
136-
expect(typeof uploadResult.root).toBe('string');
134+
// The root can be either a string or an object with toString method
135+
expect(uploadResult.root).toBeDefined();
137136
expect(uploadResult).toHaveProperty('url');
138137
expect(uploadResult).toHaveProperty('files');
139-
expect(Array.isArray(uploadResult.files)).toBe(true);
140-
expect(uploadResult.files.length).toBeGreaterThan(0);
141-
expect(uploadResult.files[0]).toHaveProperty('name');
142-
expect(uploadResult.files[0]).toHaveProperty('url');
143-
expect(uploadResult.files[0]).toHaveProperty('cid');
144-
>>>>>>> 8ed405d (feat: preserve filename using uploadDirectory)
138+
139+
// Test that files is an object with at least one entry
140+
expect(typeof uploadResult.files).toBe('object');
141+
expect(uploadResult.files).not.toBeNull();
145142
}, 30_000); // Increase the timeout for upload test
146143

147144
it('should retrieve a file', async () => {

test/unit/core/server/tools/retrieve.test.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,6 @@ import { Signer } from '@ucanto/principal/ed25519';
55
import { Delegation, Capabilities } from '@ucanto/interface';
66
import { StorachaClient } from '../../../../../src/core/storage/client.js';
77

8-
// // Mock isValidCID function from the utils.js file
9-
// vi.mock('../../../../../src/core/storage/utils.js', () => ({
10-
// isValidCID: vi.fn().mockImplementation((cid) => {
11-
// // Simple mock that considers any non-empty string a valid CID
12-
// return typeof cid === 'string' && cid.trim().length > 0;
13-
// }),
14-
// }));
15-
168
// Create mocks
179
const mockSigner = {
1810
did: () => 'did:key:mock',

0 commit comments

Comments
 (0)