Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

🔧 Update vitest config for better vscode compatability (#1404)

Luke Vella501cdd2b56b2
diff --git a/.vscode/settings.json b/.vscode/settings.json
index ee40c4498..3be68af40 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -4,5 +4,7 @@
},
"typescript.tsdk": "node_modules/typescript/lib",
"typescript.preferences.importModuleSpecifier": "non-relative",
- "cSpell.words": ["Rallly", "Vella"]
+ "cSpell.words": ["Rallly", "Vella"],
+ "jestrunner.codeLensSelector": "",
+ "vitest.filesWatcherInclude": "**/*.test.ts"
}
diff --git a/apps/web/src/utils/absolute-url.test.ts b/apps/web/src/utils/absolute-url.test.ts
index 119afffac..d9a6cc3cc 100644
--- a/apps/web/src/utils/absolute-url.test.ts
+++ b/apps/web/src/utils/absolute-url.test.ts
@@ -1,5 +1,3 @@
-import { afterAll, beforeAll, describe, expect, it } from "vitest";
-
import { absoluteUrl } from "./absolute-url";
describe("absoluteUrl", () => {
diff --git a/apps/web/src/utils/date-time-utilts.test.ts b/apps/web/src/utils/date-time-utilts.test.ts
index 4205faf8e..8665c90b9 100644
--- a/apps/web/src/utils/date-time-utilts.test.ts
+++ b/apps/web/src/utils/date-time-utilts.test.ts
@@ -1,7 +1,6 @@
import dayjs from "dayjs";
import timezone from "dayjs/plugin/timezone";
import utc from "dayjs/plugin/utc";
-import { describe, expect, it } from "vitest";
import { supportedTimeZones } from "@/utils/supported-time-zones";
diff --git a/apps/web/src/utils/get-value-by-path.test.ts b/apps/web/src/utils/get-value-by-path.test.ts
index 70ebc2e78..67450458d 100644
--- a/apps/web/src/utils/get-value-by-path.test.ts
+++ b/apps/web/src/utils/get-value-by-path.test.ts
@@ -1,5 +1,3 @@
-import { describe, expect, it } from "vitest";
-
import { getValueByPath } from "./get-value-by-path";
describe("getValueByPath", () => {
diff --git a/apps/web/tsconfig.json b/apps/web/tsconfig.json
index fbeca8746..70d2f9476 100644
--- a/apps/web/tsconfig.json
+++ b/apps/web/tsconfig.json
@@ -6,6 +6,7 @@
"@/*": ["src/*"],
},
"strictNullChecks": true,
+ "types": ["vitest/globals"],
},
"include": [
"**/*.ts",
diff --git a/apps/web/vitest.config.mts b/apps/web/vitest.config.mts
index 8ae27b7e9..00a37f4d6 100644
--- a/apps/web/vitest.config.mts
+++ b/apps/web/vitest.config.mts
@@ -3,11 +3,13 @@ import { defineConfig } from "vitest/config";
export default defineConfig({
test: {
+ globals: true,
+ include: ["**/*.test.ts"],
exclude: ["**/node_modules/**", "**/*.spec.ts"],
},
resolve: {
alias: {
- "@": path.resolve(__dirname, "src"),
+ "@": path.resolve(__dirname, "./src"),
},
},
});
diff --git a/vitest.workspace.ts b/vitest.workspace.ts
index afd90911f..446202bd5 100644
--- a/vitest.workspace.ts
+++ b/vitest.workspace.ts
@@ -1 +1 @@
-export default ["packages/*/vitest.config.ts", "apps/*/vitest.config.ts"];
+export default ["packages/*/vitest.config.mts", "apps/*/vitest.config.mts"];