mirror of
https://github.com/deepseek-ai/deepseek-harness
synced 2026-08-15 21:04:50 +00:00
The Loader verifier matched docs/cordis-primer.i18n.yaml solely because its basename contained cordis. Centralize file discovery, exclude i18n sidecars, and cover Loader YAML plus excluded trees with a regression test.
37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from 'node:fs'
|
|
import { tmpdir } from 'node:os'
|
|
import { join } from 'node:path'
|
|
import { afterEach, describe, expect, it } from 'vitest'
|
|
import { cordisConfigFiles } from './cordis-config-files.ts'
|
|
|
|
const roots: string[] = []
|
|
|
|
afterEach(() => {
|
|
for (const root of roots.splice(0)) rmSync(root, { recursive: true, force: true })
|
|
})
|
|
|
|
describe('cordisConfigFiles', () => {
|
|
it('finds Loader YAML without treating translation records as configs', () => {
|
|
const root = mkdtempSync(join(tmpdir(), 'dsh-cordis-config-files-'))
|
|
roots.push(root)
|
|
for (const directory of ['.claude', 'docs', 'examples', 'node_modules/pkg', 'vendor/pkg']) {
|
|
mkdirSync(join(root, directory), { recursive: true })
|
|
}
|
|
for (const file of [
|
|
'.claude/hidden.cordis.yml',
|
|
'docs/cordis-primer.i18n.yaml',
|
|
'examples/agent.cordis.yaml',
|
|
'examples/headless.cordis.yml',
|
|
'node_modules/pkg/hidden.cordis.yml',
|
|
'vendor/pkg/hidden.cordis.yml',
|
|
]) {
|
|
writeFileSync(join(root, file), '[]\n')
|
|
}
|
|
|
|
expect(cordisConfigFiles(root)).toEqual([
|
|
'examples/agent.cordis.yaml',
|
|
'examples/headless.cordis.yml',
|
|
])
|
|
})
|
|
})
|