Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions services/mcp/tests/integration/manifest.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { describe, expect, it } from 'vitest'
import { fetchContextMillResources, loadManifestFromArchive } from '@/resources/internals'

describe('Context-Mill Manifest Integration', () => {
it('should fetch, unzip, and validate available resources from GitHub releases', async () => {
it('should fetch, unzip, and validate the manifest from GitHub releases', async () => {
const archive = await fetchContextMillResources()

// Verify archive is not empty
Expand All @@ -16,19 +16,19 @@ describe('Context-Mill Manifest Integration', () => {
expect(validatedManifest.version).toBe('1.0')
expect(Array.isArray(validatedManifest.resources)).toBe(true)

// The manifest may include resources that are not part of the aggregate archive.
const availableResources = validatedManifest.resources.filter((entry) => !entry.file || archive[entry.file])
// Verify we have actual resources
expect(validatedManifest.resources.length).toBeGreaterThan(0)

// Verify the archive contains actual resources
expect(availableResources.length).toBeGreaterThan(0)

// Verify each available resource has required fields
for (const entry of availableResources) {
// Verify each resource has required fields and its file exists in archive
for (const entry of validatedManifest.resources) {
expect(entry.id).toBeTruthy()
expect(entry.name).toBeTruthy()
expect(entry.resource).toBeTruthy()
expect(entry.resource.mimeType).toBeTruthy()
expect(entry.resource.text).toBeTruthy()
if (entry.file) {
expect(archive[entry.file]).toBeTruthy()
}
}
}, 30000)
})
Loading