26 lines
971 B
TypeScript
26 lines
971 B
TypeScript
/** The headless bundle's declared profile patch. */
|
|
|
|
import { readFileSync } from 'node:fs'
|
|
import { resolve } from 'node:path'
|
|
import { fileURLToPath } from 'node:url'
|
|
import * as yaml from 'js-yaml'
|
|
import { describe, expect, it } from 'vitest'
|
|
import { entryListSchema } from '@deepseek-ai/cordis-plugin-include'
|
|
|
|
describe('dsh-headless bundle', () => {
|
|
it('enables public Web fetch over the shared base', () => {
|
|
const root = fileURLToPath(new URL('..', import.meta.url))
|
|
const manifest = JSON.parse(readFileSync(resolve(root, 'package.json'), 'utf8')) as {
|
|
dsh?: { bundle?: { patch?: string } }
|
|
}
|
|
const patches = yaml.load(
|
|
readFileSync(resolve(root, manifest.dsh!.bundle!.patch!), 'utf8'),
|
|
{ schema: entryListSchema },
|
|
) as Array<{ id?: string; config?: Record<string, unknown> }>
|
|
|
|
expect(patches.find(patch => patch.id === 'tool-web')?.config).toEqual({
|
|
fetch: true,
|
|
searchTimeoutMs: 60_000,
|
|
})
|
|
})
|
|
})
|