diff --git a/src/main.ts b/src/main.ts index 5a028a6..1d15c43 100644 --- a/src/main.ts +++ b/src/main.ts @@ -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() { diff --git a/src/test.ts b/src/test.ts new file mode 100644 index 0000000..26fa586 --- /dev/null +++ b/src/test.ts @@ -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 +}