mirror of
https://github.com/badlogic/pi-mono.git
synced 2026-11-05 23:37:25 +00:00
Runs the storage conformance suite, the schema migration, an alarm-woken sleep across an eviction, and a turn recovered through the recovery alarm in workerd via @cloudflare/vitest-plugin (npm run test:workers). fix(durable): decline background timers in Cloudflare Workers. With nodejs_compat, timers have an unref(), so the idle-memory timers were armed and a pending one kept a Durable Object from hibernating or being evicted.
22 lines
798 B
TypeScript
22 lines
798 B
TypeScript
import { fileURLToPath } from "node:url";
|
|
import { configDefaults, defineConfig } from "vitest/config";
|
|
|
|
const durableSrcIndex = fileURLToPath(new URL("./src/index.ts", import.meta.url));
|
|
const durableSrcTesting = fileURLToPath(new URL("./src/testing/index.ts", import.meta.url));
|
|
|
|
export default defineConfig({
|
|
test: {
|
|
environment: "node",
|
|
// Run in workerd by their own config: `npm run test:workers`.
|
|
exclude: [...configDefaults.exclude, "test-workers/**"],
|
|
setupFiles: ["./test/setup-document-retention.ts"],
|
|
},
|
|
resolve: {
|
|
conditions: ["source"],
|
|
alias: [
|
|
{ find: /^@earendil-works\/pi-durable$/, replacement: durableSrcIndex },
|
|
{ find: /^@earendil-works\/pi-durable\/testing$/, replacement: durableSrcTesting },
|
|
],
|
|
},
|
|
ssr: { resolve: { conditions: ["source"] } },
|
|
});
|