From cc5689eaf4f7cfa158e31107906434da9aed62bf Mon Sep 17 00:00:00 2001 From: lonkaars Date: Thu, 29 Jun 2023 23:25:01 +0200 Subject: WIP examples + change `.prepare()` to `await .ready` --- test/reading/test.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/reading') diff --git a/test/reading/test.ts b/test/reading/test.ts index 9d426d4..9caf890 100644 --- a/test/reading/test.ts +++ b/test/reading/test.ts @@ -17,7 +17,8 @@ interface Test { tags: Array; }; -const tests = JSON.parse(await Deno.readTextFile(path.resolve('test', 'reading', 'cases.json'))) as Test[]; +const here = path.dirname(path.fromFileUrl(import.meta.url)); +const tests = JSON.parse(await Deno.readTextFile(path.resolve(here, 'cases.json'))) as Test[]; console.log(`amount of sentences: ${tests.length}`); console.log(`average sentence length: ${tests.map(t => t.test.input.length).reduce((a, b) => a + b) / tests.length}`); -- cgit v1.2.3