mirror of
https://github.com/talwrii/plugin-repl.git
synced 2026-07-22 11:40:27 +00:00
the beginning of some tests
This commit is contained in:
parent
782a59b142
commit
653523a674
2 changed files with 23 additions and 0 deletions
|
|
@ -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
16
src/test.ts
Normal 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
|
||||
}
|
||||
Loading…
Reference in a new issue