ci: establish trusted quality baseline
This commit is contained in:
+43
-3
@@ -1,5 +1,26 @@
|
||||
import { defineConfig } from "vitest/config";
|
||||
import path from "node:path";
|
||||
import { allowedNodeEnvironmentFlags } from "node:process";
|
||||
|
||||
const baseExclude = [
|
||||
"**/node_modules/**",
|
||||
"**/dist/**",
|
||||
"**/.next/**",
|
||||
"e2e/**",
|
||||
];
|
||||
|
||||
const browserTestFiles = [
|
||||
"src/data/repositories/__tests__/chat_media_cache_coordinator.test.ts",
|
||||
"src/lib/analytics/__tests__/behavior_analytics.test.ts",
|
||||
"src/utils/__tests__/result.test.ts",
|
||||
"src/utils/__tests__/pwa.test.ts",
|
||||
];
|
||||
|
||||
const workerExecArgv = allowedNodeEnvironmentFlags.has(
|
||||
"--no-experimental-webstorage",
|
||||
)
|
||||
? ["--no-experimental-webstorage"]
|
||||
: [];
|
||||
|
||||
export default defineConfig({
|
||||
resolve: {
|
||||
@@ -8,8 +29,27 @@ export default defineConfig({
|
||||
},
|
||||
},
|
||||
test: {
|
||||
environment: "jsdom",
|
||||
exclude: ["**/node_modules/**", "**/dist/**", "**/.next/**", "e2e/**"],
|
||||
globals: true,
|
||||
projects: [
|
||||
{
|
||||
extends: true,
|
||||
test: {
|
||||
name: "node",
|
||||
environment: "node",
|
||||
execArgv: workerExecArgv,
|
||||
include: ["src/**/*.{test,spec}.ts"],
|
||||
exclude: [...baseExclude, ...browserTestFiles],
|
||||
},
|
||||
},
|
||||
{
|
||||
extends: true,
|
||||
test: {
|
||||
name: "jsdom",
|
||||
environment: "jsdom",
|
||||
execArgv: workerExecArgv,
|
||||
include: ["src/**/*.{test,spec}.tsx", ...browserTestFiles],
|
||||
exclude: baseExclude,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user