mirror of
https://github.com/t8y2/dbx.git
synced 2026-10-02 02:34:42 +08:00
30 lines
1.4 KiB
TypeScript
30 lines
1.4 KiB
TypeScript
import path from "node:path";
|
|
import vue from "@vitejs/plugin-vue";
|
|
import { defineConfig } from "vitest/config";
|
|
|
|
export default defineConfig({
|
|
plugins: [vue()],
|
|
resolve: {
|
|
alias: {
|
|
"@": path.resolve(import.meta.dirname, "apps/desktop/src"),
|
|
"@dbx-app/mongo-shell": path.resolve(import.meta.dirname, "packages/mongo-shell/src/index.ts"),
|
|
// sql-formatter's `exports` map only declares ".", so deep imports into its
|
|
// bundled parser/tokenizer are rejected by Vite's exports handling. The
|
|
// The default layout engine needs that AST; see lib/sql/layout/internals.ts.
|
|
"sql-formatter/dist/": `${path.resolve(import.meta.dirname, "node_modules/sql-formatter/dist")}/`,
|
|
},
|
|
},
|
|
test: {
|
|
include: ["packages/app-tests/*.test.ts", "apps/desktop/src/**/*.spec.ts", "docs/lib/*.test.ts"],
|
|
globalSetup: "packages/test-globals.ts",
|
|
// Many specs dynamically import the large store modules (connectionStore,
|
|
// queryStore) inside test bodies; when several workers pay that first
|
|
// import at once, CPU contention can stall a worker's event loop past the
|
|
// old 5s default and flake deferred-promise tests. A 10s timeout absorbs
|
|
// that without capping throughput, so workers can scale past 4. CI keeps
|
|
// 4 workers to match each runner's CPU count.
|
|
testTimeout: 10_000,
|
|
maxWorkers: process.env.CI ? 4 : 8,
|
|
},
|
|
});
|