mirror of
https://github.com/langgenius/dify.git
synced 2026-07-22 03:08:33 +08:00
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
23 lines
767 B
TypeScript
23 lines
767 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { longVersion, shortVersion, userAgent } from './info'
|
|
|
|
describe('version info', () => {
|
|
it('shortVersion returns the build-injected version string', () => {
|
|
expect(shortVersion()).toMatch(/^\d+\.\d+\.\d+(-[\w.]+)?$/)
|
|
})
|
|
|
|
it('longVersion includes commit, build date, channel, and compat range', () => {
|
|
const out = longVersion()
|
|
expect(out).toMatch(/^difyctl /)
|
|
expect(out).toContain('commit')
|
|
expect(out).toContain('built')
|
|
expect(out).toContain('channel')
|
|
expect(out).toContain('compat:')
|
|
expect(out).toMatch(/dify >=\d+\.\d+\.\d.*, <=\d+\.\d+\.\d+/)
|
|
})
|
|
|
|
it('userAgent is well-formed', () => {
|
|
expect(userAgent()).toMatch(/^difyctl\/\S+ \(\S+; \S+; \S+\)$/)
|
|
})
|
|
})
|