dify/cli/src/commands/coverage.test.ts
Yunlu Wen c0ee821d45
refactor: use absolute path for inter dir importing (#36822)
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-06-01 01:32:16 +00:00

25 lines
753 B
TypeScript

/// <reference types="vite/client" />
import { describe, expect, it } from 'vitest'
import { isExcludedCommandPath } from '@/framework/command-fs'
const INDEX_MODULES = import.meta.glob<{ default?: unknown }>(
'./**/index.ts',
{ eager: true },
)
const COMMAND_MODULES = Object.fromEntries(
Object.entries(INDEX_MODULES).filter(([path]) => !isExcludedCommandPath(path)),
)
describe('command folder coverage', () => {
it('discovers at least one command index', () => {
expect(Object.keys(COMMAND_MODULES).length).toBeGreaterThan(0)
})
describe.each(Object.entries(COMMAND_MODULES))('%s', (path, mod) => {
it('default export exists', () => {
expect(mod.default, `${path}: missing default export`).toBeDefined()
})
})
})