Skip to content

armgit / core

Public Imported from GitHub
0

100% open-source IoT Platform - Integrate your devices, add intelligence, build custom apps

Type check manager test directory (#3367)

Koenbbbecc6978c7
diff --git a/ui/app/manager/package.json b/ui/app/manager/package.json
index ce1932619..2ed615cdd 100644
--- a/ui/app/manager/package.json
+++ b/ui/app/manager/package.json
@@ -30,7 +30,7 @@
"serve:experimental": "npx tsc -b --clean && npx shx rm -rf build && npx orutil build && npx cross-env NODE_OPTIONS=--max_old_space_size=4096 rsbuild dev",
"serveNoModelBuild": "npx tsc -b --clean && npx cross-env NODE_OPTIONS=--max_old_space_size=4096 rspack serve --mode development",
"serveNoModelBuild:experimental": "npx tsc -b --clean && npx cross-env NODE_OPTIONS=--max_old_space_size=4096 rsbuild dev",
- "test": "npx playwright test",
+ "test": "npx tsc -p test && npx playwright test",
"prepack": "npx tsc -b"
},
"dependencies": {
diff --git a/ui/app/manager/test/fixtures/manager.ts b/ui/app/manager/test/fixtures/manager.ts
index cc288c3c8..37ba1ea33 100644
--- a/ui/app/manager/test/fixtures/manager.ts
+++ b/ui/app/manager/test/fixtures/manager.ts
@@ -426,7 +426,7 @@ export class Manager {
*/
async resetUserPassword(config?: AxiosRequestConfig<any>) {
try {
- const response = await rest.api.UserResource.resetPassword(
+ const response = await rest.api.UserResource.updatePassword(
this.realm!,
this.user!.id!,
{ value: smartcity.password },
diff --git a/ui/app/manager/test/tsconfig.json b/ui/app/manager/test/tsconfig.json
new file mode 100644
index 000000000..35146d93d
--- /dev/null
+++ b/ui/app/manager/test/tsconfig.json
@@ -0,0 +1,14 @@
+{
+ "extends": "../../../tsconfig",
+ "compilerOptions": {
+ "moduleResolution": "bundler",
+ "composite": false,
+ "declaration": false,
+ "declarationMap": false,
+ "sourceMap": false,
+ "noEmit": true,
+ "skipLibCheck": true,
+ "strict": false
+ },
+ "include": ["."]
+}
diff --git a/ui/test/build.gradle b/ui/test/build.gradle
index 28f031a5a..0eca72fc9 100644
--- a/ui/test/build.gradle
+++ b/ui/test/build.gradle
@@ -14,5 +14,7 @@ def yarnInstallRequested = gradle.startParameter.taskNames.any {
tasks.register('installTestDeps', Exec) {
onlyIf { !yarnInstallRequested }
- commandLine npmCommand("yarn"), "workspaces", "focus", "@openremote/test", "@openremote/model", "@openremote/rest", "@openremote/core"
+ // The app test tree is type checked, which reaches the app sources and every package they import, so the app
+ // workspace has to be installed whole rather than the subset the tests themselves import
+ commandLine npmCommand("yarn"), "workspaces", "focus", "@openremote/test", "@openremote/model", "@openremote/rest", "@openremote/core", "@openremote/manager"
}
diff --git a/ui/test/plugin/index.ts b/ui/test/plugin/index.ts
index edd3d855b..40c8ab0c5 100644
--- a/ui/test/plugin/index.ts
+++ b/ui/test/plugin/index.ts
@@ -22,7 +22,7 @@ import rspack, { type DevServer, type Configuration } from "@rspack/core";
import { RspackDevServer } from "@rspack/dev-server";
import HtmlWebpackPlugin from "html-webpack-plugin";
-// @ts-expect-error No declaration file available
+// @ts-ignore No declaration file available
import { getStandardModuleRules } from "@openremote/util";
import { isURLAvailable } from "playwright-core/lib/utils";