From b62044b4b8bbc8ef7ee6a72aaae6d0dbd2baabaa Mon Sep 17 00:00:00 2001 From: Adria Navarro Date: Tue, 19 Mar 2024 23:26:04 +0100 Subject: [PATCH] Fix tests --- packages/shared-core/jest.config.ts | 10 ++++++++++ packages/shared-core/src/tests/cron.test.ts | 1 - packages/shared-core/src/tests/filters.test.ts | 1 - packages/shared-core/tsconfig.json | 3 ++- 4 files changed, 12 insertions(+), 3 deletions(-) create mode 100644 packages/shared-core/jest.config.ts diff --git a/packages/shared-core/jest.config.ts b/packages/shared-core/jest.config.ts new file mode 100644 index 0000000000..5c7c870b58 --- /dev/null +++ b/packages/shared-core/jest.config.ts @@ -0,0 +1,10 @@ +export default { + preset: "ts-jest", + testEnvironment: "node", + transform: { + "^.+\\.ts?$": "@swc/jest", + }, + moduleNameMapper: { + "@budibase/types": "/../types/src", + }, +} diff --git a/packages/shared-core/src/tests/cron.test.ts b/packages/shared-core/src/tests/cron.test.ts index d56165b2b8..3945acb565 100644 --- a/packages/shared-core/src/tests/cron.test.ts +++ b/packages/shared-core/src/tests/cron.test.ts @@ -1,4 +1,3 @@ -import { expect, describe, it } from "vitest" import { cron } from "../helpers" describe("check valid and invalid crons", () => { diff --git a/packages/shared-core/src/tests/filters.test.ts b/packages/shared-core/src/tests/filters.test.ts index de969562af..b7126f7477 100644 --- a/packages/shared-core/src/tests/filters.test.ts +++ b/packages/shared-core/src/tests/filters.test.ts @@ -5,7 +5,6 @@ import { SearchFilter, } from "@budibase/types" import { buildLuceneQuery, runLuceneQuery } from "../filters" -import { expect, describe, it, test } from "vitest" describe("runLuceneQuery", () => { const docs = [ diff --git a/packages/shared-core/tsconfig.json b/packages/shared-core/tsconfig.json index 5e3d49c8b9..d0c5134f1c 100644 --- a/packages/shared-core/tsconfig.json +++ b/packages/shared-core/tsconfig.json @@ -3,7 +3,8 @@ "compilerOptions": { "baseUrl": "..", "rootDir": "src", - "composite": true + "composite": true, + "types": ["node", "jest"] }, "exclude": ["node_modules", "dist"] }