aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorlonkaars <loek@pipeframe.xyz>2023-07-06 18:23:02 +0200
committerlonkaars <loek@pipeframe.xyz>2023-07-06 18:23:02 +0200
commitcd01df3747ff361fab819fd1d30fac1dba6240e1 (patch)
tree2333eee43667c5cae6d8cebf6cc67bb5fb5a718e /test
parentcb78013884e3aa3b1e1a91722f5eeb78c62f6796 (diff)
update tests and examples
Diffstat (limited to 'test')
-rw-r--r--test/base.ts8
-rw-r--r--test/deinflection/test.ts4
-rw-r--r--test/reading/test.ts9
3 files changed, 10 insertions, 11 deletions
diff --git a/test/base.ts b/test/base.ts
index 0390169..79c39ce 100644
--- a/test/base.ts
+++ b/test/base.ts
@@ -1,2 +1,10 @@
export { assertEquals } from "https://deno.land/std@0.193.0/testing/asserts.ts";
+import Yomikun from "../api/yomikun.ts";
+import DirectCoreClient from '../core/direct/client.ts';
+
+export const core = new DirectCoreClient();
+export const api = new Yomikun(core);
+
+await api.ready;
+
diff --git a/test/deinflection/test.ts b/test/deinflection/test.ts
index 3dc702b..5a123ba 100644
--- a/test/deinflection/test.ts
+++ b/test/deinflection/test.ts
@@ -1,8 +1,6 @@
import DirectCoreClient from '../../core/direct/client.ts';
import cases from "./cases.ts";
-
-var core = new DirectCoreClient();
-await core.ready;
+import { core } from '../base.ts';
cases.forEach(({ input, tags }) => {
Deno.test(`deinflection - ${input}`, async () => {
diff --git a/test/reading/test.ts b/test/reading/test.ts
index 6a82b3f..a2524de 100644
--- a/test/reading/test.ts
+++ b/test/reading/test.ts
@@ -1,13 +1,6 @@
-import { assertEquals } from "../base.ts";
+import { api, assertEquals } from "../base.ts";
import cases from "./cases.ts";
-import Yomikun from "../../api/yomikun.ts";
-import DirectCoreClient from '../../core/direct/client.ts';
-
-var core = new DirectCoreClient();
-await core.ready;
-var api = new Yomikun(core);
-
cases.forEach(({input, output}) => {
Deno.test(`Sentence reading - ${input}`, async () => {
// TODO: use sentence reading and tags