Add tests and search simulator TUI

This commit is contained in:
Tanner
2026-09-08 17:55:40 +00:00
parent ba13d435df
commit f780ed220c
15 changed files with 868 additions and 9 deletions
+23
View File
@@ -0,0 +1,23 @@
import path from 'node:path'
export class TFile {
path = ''
basename = ''
stat = { mtime: 1 }
constructor(filePath = '') {
this.path = filePath
this.basename = path.basename(filePath, path.extname(filePath))
}
}
export const Notice = jest.fn()
export const Platform = { isMacOS: false }
export const normalizePath = (value: string) => value.replaceAll('\\', '/')
export const getAllTags = (metadata: any) => metadata?.tags ?? []
export const parseFrontMatterAliases = (frontmatter: any) => {
const aliases = frontmatter?.aliases
if (!aliases) return []
return Array.isArray(aliases)
? aliases
: String(aliases).split(',').map(alias => alias.trim()).filter(Boolean)
}