mirror of
https://github.com/langgenius/dify.git
synced 2026-06-11 10:57:40 +08:00
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
25 lines
753 B
TypeScript
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()
|
|
})
|
|
})
|
|
})
|