the beginning of some tests

This commit is contained in:
Tal Wrii 2025-03-14 19:48:14 +01:00
parent 782a59b142
commit 653523a674
2 changed files with 23 additions and 0 deletions

View file

@ -23,6 +23,7 @@ import { promptCommand } from './promptCommand'
import { popup } from './popup'
import { openSetting } from './settings'
import { templater_expand } from './templater'
import { test } from './test'
interface PrivateMarkdownView extends MarkdownView {
titleEl: HTMLElement
@ -335,6 +336,12 @@ export default class ReplPlugin extends Plugin {
"view", view,
"The view for the current not (See Obsidian api)"
)
this.addToScopeWithDoc(
"test", test,
"Run some tests."
)
}
makeNewCommand() {

16
src/test.ts Normal file
View file

@ -0,0 +1,16 @@
import { Notice } from 'obsidian';
export function test() {
try {
testInner()
}
catch (e) {
new Notice("Tests failed.")
return
}
new Notice("Tested passed.")
}
function testInner() {
1
}