Files
X-Financial/web/tests/settings-llm-section.test.mjs

24 lines
807 B
JavaScript
Raw Permalink Normal View History

import assert from 'node:assert/strict'
import { readFileSync } from 'node:fs'
const settingsScript = readFileSync(new URL('../src/views/scripts/SettingsView.js', import.meta.url), 'utf8')
const settingsView = readFileSync(new URL('../src/views/SettingsView.vue', import.meta.url), 'utf8')
function testLlmSectionReplacesVlmWithReranker() {
assert.doesNotMatch(settingsView, /VLM 模型/)
assert.match(settingsView, /Reranker 模型配置/)
assert.match(settingsScript, /rerankerProvider/)
}
function testRerankerCardRendersAfterEmbeddingCard() {
assert.match(settingsView, /Embedding 模型配置[\s\S]*Reranker 模型配置/)
}
function run() {
testLlmSectionReplacesVlmWithReranker()
testRerankerCardRendersAfterEmbeddingCard()
console.log('settings llm section tests passed')
}
run()