aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
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