From 653523a6741c8c435d75306de515d642ffa042b9 Mon Sep 17 00:00:00 2001 From: Tal Wrii Date: Fri, 14 Mar 2025 19:48:14 +0100 Subject: [PATCH] the beginning of some tests --- src/main.ts | 7 +++++++ src/test.ts | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/test.ts 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 +}