From cbbb643ed02a4070c7138705c08f347cf9911f38 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Tue, 3 Dec 2024 13:53:13 +0100 Subject: [PATCH] chore(common): rename `common/web/types/test` to `.../tests` Addresses code review comment. --- common/web/types/.eslintrc.cjs | 4 ++-- common/web/types/build.sh | 2 +- common/web/types/package.json | 6 +++--- .../{test => tests}/fixtures/kmx/khmer_angkor.kmx | Bin .../{test => tests}/fixtures/kvk/balochi_inpage.kvk | Bin .../{test => tests}/fixtures/kvk/khmer_angkor.kvk | Bin common/web/types/{test => tests}/helpers/index.ts | 2 +- .../{test => tests}/kmx/keyman-targets.tests.ts | 0 .../web/types/{test => tests}/kmx/kmx-file.tests.ts | 0 .../web/types/{test => tests}/kvk/kvk-file.tests.ts | 0 .../types/{test => tests}/kvk/kvk-utils.tests.ts | 0 .../ldml-keyboard/pattern-parser.tests.ts | 0 .../ldml-keyboard/string-list.tests.ts | 0 .../{test => tests}/lexical-model-types.tests.ts | 0 common/web/types/{test => tests}/tsconfig.json | 2 +- .../types/{test => tests}/util/unescape.tests.ts | 0 16 files changed, 8 insertions(+), 8 deletions(-) rename common/web/types/{test => tests}/fixtures/kmx/khmer_angkor.kmx (100%) rename common/web/types/{test => tests}/fixtures/kvk/balochi_inpage.kvk (100%) rename common/web/types/{test => tests}/fixtures/kvk/khmer_angkor.kvk (100%) rename common/web/types/{test => tests}/helpers/index.ts (87%) rename common/web/types/{test => tests}/kmx/keyman-targets.tests.ts (100%) rename common/web/types/{test => tests}/kmx/kmx-file.tests.ts (100%) rename common/web/types/{test => tests}/kvk/kvk-file.tests.ts (100%) rename common/web/types/{test => tests}/kvk/kvk-utils.tests.ts (100%) rename common/web/types/{test => tests}/ldml-keyboard/pattern-parser.tests.ts (100%) rename common/web/types/{test => tests}/ldml-keyboard/string-list.tests.ts (100%) rename common/web/types/{test => tests}/lexical-model-types.tests.ts (100%) rename common/web/types/{test => tests}/tsconfig.json (93%) rename common/web/types/{test => tests}/util/unescape.tests.ts (100%) diff --git a/common/web/types/.eslintrc.cjs b/common/web/types/.eslintrc.cjs index b28ba0941b1..4fd5954e495 100644 --- a/common/web/types/.eslintrc.cjs +++ b/common/web/types/.eslintrc.cjs @@ -1,13 +1,13 @@ module.exports = { parserOptions: { - project: ["./tsconfig.json", "./test/tsconfig.json"], + project: ["./tsconfig.json", "./tests/tsconfig.json"], }, ignorePatterns: [ ".*/*", "build/*", "coverage/*", "node_modules/*", - "test/fixtures/*", + "tests/fixtures/*", "tools/*", "src/schemas/*" ], diff --git a/common/web/types/build.sh b/common/web/types/build.sh index 75273aaa2c9..418840d1a85 100755 --- a/common/web/types/build.sh +++ b/common/web/types/build.sh @@ -88,7 +88,7 @@ function do_test() { fi eslint . - tsc --build test + tsc --build tests readonly C8_THRESHOLD=60 diff --git a/common/web/types/package.json b/common/web/types/package.json index f78557cb524..d6efc635039 100644 --- a/common/web/types/package.json +++ b/common/web/types/package.json @@ -23,7 +23,7 @@ "build": "tsc -b", "build:schema": "ajv compile", "lint": "eslint .", - "test": "npm run lint && cd test && tsc -b && cd .. && c8 --skip-full --reporter=lcov --reporter=text mocha" + "test": "npm run lint && cd tests && tsc -b && cd .. && c8 --skip-full --reporter=lcov --reporter=text mocha" }, "author": "Marc Durdin (https://github.com/mcdurdin)", "license": "MIT", @@ -48,7 +48,7 @@ "typescript": "^5.4.5" }, "mocha": { - "spec": "build/test/**/*.tests.js", + "spec": "build/tests/**/*.tests.js", "require": [ "source-map-support/register" ] @@ -76,7 +76,7 @@ "src/keyman-touch-layout/keyman-touch-layout-file-writer.ts", "src/osk/osk.ts", "src/schemas/*", - "test/" + "tests/" ] }, "sideEffects": false diff --git a/common/web/types/test/fixtures/kmx/khmer_angkor.kmx b/common/web/types/tests/fixtures/kmx/khmer_angkor.kmx similarity index 100% rename from common/web/types/test/fixtures/kmx/khmer_angkor.kmx rename to common/web/types/tests/fixtures/kmx/khmer_angkor.kmx diff --git a/common/web/types/test/fixtures/kvk/balochi_inpage.kvk b/common/web/types/tests/fixtures/kvk/balochi_inpage.kvk similarity index 100% rename from common/web/types/test/fixtures/kvk/balochi_inpage.kvk rename to common/web/types/tests/fixtures/kvk/balochi_inpage.kvk diff --git a/common/web/types/test/fixtures/kvk/khmer_angkor.kvk b/common/web/types/tests/fixtures/kvk/khmer_angkor.kvk similarity index 100% rename from common/web/types/test/fixtures/kvk/khmer_angkor.kvk rename to common/web/types/tests/fixtures/kvk/khmer_angkor.kvk diff --git a/common/web/types/test/helpers/index.ts b/common/web/types/tests/helpers/index.ts similarity index 87% rename from common/web/types/test/helpers/index.ts rename to common/web/types/tests/helpers/index.ts index 3e305eeca8a..717b2e75191 100644 --- a/common/web/types/test/helpers/index.ts +++ b/common/web/types/tests/helpers/index.ts @@ -9,5 +9,5 @@ import { fileURLToPath } from "url"; * @param components One or more path components. */ export function makePathToFixture(...components: string[]): string { - return fileURLToPath(new URL(path.join('..', '..', '..', 'test', 'fixtures', ...components), import.meta.url)); + return fileURLToPath(new URL(path.join('..', '..', '..', 'tests', 'fixtures', ...components), import.meta.url)); } diff --git a/common/web/types/test/kmx/keyman-targets.tests.ts b/common/web/types/tests/kmx/keyman-targets.tests.ts similarity index 100% rename from common/web/types/test/kmx/keyman-targets.tests.ts rename to common/web/types/tests/kmx/keyman-targets.tests.ts diff --git a/common/web/types/test/kmx/kmx-file.tests.ts b/common/web/types/tests/kmx/kmx-file.tests.ts similarity index 100% rename from common/web/types/test/kmx/kmx-file.tests.ts rename to common/web/types/tests/kmx/kmx-file.tests.ts diff --git a/common/web/types/test/kvk/kvk-file.tests.ts b/common/web/types/tests/kvk/kvk-file.tests.ts similarity index 100% rename from common/web/types/test/kvk/kvk-file.tests.ts rename to common/web/types/tests/kvk/kvk-file.tests.ts diff --git a/common/web/types/test/kvk/kvk-utils.tests.ts b/common/web/types/tests/kvk/kvk-utils.tests.ts similarity index 100% rename from common/web/types/test/kvk/kvk-utils.tests.ts rename to common/web/types/tests/kvk/kvk-utils.tests.ts diff --git a/common/web/types/test/ldml-keyboard/pattern-parser.tests.ts b/common/web/types/tests/ldml-keyboard/pattern-parser.tests.ts similarity index 100% rename from common/web/types/test/ldml-keyboard/pattern-parser.tests.ts rename to common/web/types/tests/ldml-keyboard/pattern-parser.tests.ts diff --git a/common/web/types/test/ldml-keyboard/string-list.tests.ts b/common/web/types/tests/ldml-keyboard/string-list.tests.ts similarity index 100% rename from common/web/types/test/ldml-keyboard/string-list.tests.ts rename to common/web/types/tests/ldml-keyboard/string-list.tests.ts diff --git a/common/web/types/test/lexical-model-types.tests.ts b/common/web/types/tests/lexical-model-types.tests.ts similarity index 100% rename from common/web/types/test/lexical-model-types.tests.ts rename to common/web/types/tests/lexical-model-types.tests.ts diff --git a/common/web/types/test/tsconfig.json b/common/web/types/tests/tsconfig.json similarity index 93% rename from common/web/types/test/tsconfig.json rename to common/web/types/tests/tsconfig.json index 21b4145e594..45e5311fdc0 100644 --- a/common/web/types/test/tsconfig.json +++ b/common/web/types/tests/tsconfig.json @@ -4,7 +4,7 @@ "compilerOptions": { "rootDir": ".", "rootDirs": ["./", "../src/"], - "outDir": "../build/test", + "outDir": "../build/tests", "baseUrl": ".", "strictNullChecks": false, // TODO: get rid of this as some point "allowSyntheticDefaultImports": true diff --git a/common/web/types/test/util/unescape.tests.ts b/common/web/types/tests/util/unescape.tests.ts similarity index 100% rename from common/web/types/test/util/unescape.tests.ts rename to common/web/types/tests/util/unescape.tests.ts