From abbe9deb1ce090d0d4196aa993260fea4d06a9df Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 19 Mar 2024 23:28:03 +0100 Subject: [PATCH] Add test command --- packages/shared-core/package.json | 4 +++- packages/worker/scripts/test.sh | 8 ++++---- packages/worker/src/sdk/auth/tests/auth.spec.ts | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/shared-core/package.json b/packages/shared-core/package.json index cdf38f49e7..c024d1b819 100644 --- a/packages/shared-core/package.json +++ b/packages/shared-core/package.json @@ -11,7 +11,9 @@ "build": "node ../../scripts/build.js && tsc -p tsconfig.build.json --emitDeclarationOnly --paths null", "build:dev": "yarn prebuild && tsc --build --watch --preserveWatchOutput", "dev": "tsc -p tsconfig.json --watch --preserveWatchOutput", - "check:types": "tsc -p tsconfig.json --noEmit --paths null" + "check:types": "tsc -p tsconfig.json --noEmit --paths null", + "test": "jest", + "test:watch": "yarn test --watchAll" }, "dependencies": { "@budibase/types": "0.0.0", diff --git a/packages/worker/scripts/test.sh b/packages/worker/scripts/test.sh index 17b3ee17f4..4191674538 100644 --- a/packages/worker/scripts/test.sh +++ b/packages/worker/scripts/test.sh @@ -4,10 +4,10 @@ set -e if [[ -n $CI ]] then # Running in ci, where resources are limited - echo "jest --coverage --maxWorkers=2 --forceExit --bail $@" - jest --coverage --maxWorkers=2 --forceExit --bail $@ + echo "jest --coverage --maxWorkers=2 --forceExit --bail $@" + jest --coverage --maxWorkers=2 --forceExit --bail $@ else # --maxWorkers performs better in development - echo "jest --coverage --maxWorkers=2 --forceExit $@" - jest --coverage --maxWorkers=2 --forceExit $@ + echo "jest --coverage --detectOpenHandles $@" + jest --coverage --detectOpenHandles $@ fi \ No newline at end of file diff --git a/packages/worker/src/sdk/auth/tests/auth.spec.ts b/packages/worker/src/sdk/auth/tests/auth.spec.ts index e9f348f7c7..894a3e6eca 100644 --- a/packages/worker/src/sdk/auth/tests/auth.spec.ts +++ b/packages/worker/src/sdk/auth/tests/auth.spec.ts @@ -6,6 +6,8 @@ import { TestConfiguration } from "../../../tests" describe("auth", () => { const config = new TestConfiguration() + afterAll(config.afterAll) + describe("resetUpdate", () => { it("providing a valid code will update the password", async () => { await context.doInTenant(structures.tenant.id(), async () => {