@ronkovic/aad 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +312 -0
- package/bin/aad.js +2 -0
- package/package.json +78 -0
- package/src/__tests__/e2e/pipeline-e2e.test.ts +279 -0
- package/src/__tests__/e2e/resume-e2e.test.ts +200 -0
- package/src/__tests__/integration/cli-smoke.test.ts +175 -0
- package/src/__tests__/integration/pipeline.test.ts +346 -0
- package/src/bun-imports.d.ts +14 -0
- package/src/main.ts +52 -0
- package/src/modules/claude-provider/__tests__/claude-cli.adapter.test.ts +277 -0
- package/src/modules/claude-provider/__tests__/claude-sdk-real-env.test.ts +127 -0
- package/src/modules/claude-provider/__tests__/claude-sdk.adapter.test.ts +347 -0
- package/src/modules/claude-provider/__tests__/effort-strategy.test.ts +212 -0
- package/src/modules/claude-provider/__tests__/provider-registry.test.ts +251 -0
- package/src/modules/claude-provider/__tests__/retry.test.ts +201 -0
- package/src/modules/claude-provider/claude-cli.adapter.ts +156 -0
- package/src/modules/claude-provider/claude-provider.port.ts +35 -0
- package/src/modules/claude-provider/claude-sdk.adapter.ts +217 -0
- package/src/modules/claude-provider/effort-strategy.ts +94 -0
- package/src/modules/claude-provider/index.ts +32 -0
- package/src/modules/claude-provider/provider-registry.ts +92 -0
- package/src/modules/claude-provider/retry.ts +81 -0
- package/src/modules/cli/__tests__/app.test.ts +160 -0
- package/src/modules/cli/__tests__/cleanup.test.ts +111 -0
- package/src/modules/cli/__tests__/commands.test.ts +186 -0
- package/src/modules/cli/__tests__/output.test.ts +329 -0
- package/src/modules/cli/__tests__/resume.test.ts +324 -0
- package/src/modules/cli/__tests__/run.test.ts +168 -0
- package/src/modules/cli/__tests__/shutdown.test.ts +168 -0
- package/src/modules/cli/__tests__/status.test.ts +144 -0
- package/src/modules/cli/app.ts +241 -0
- package/src/modules/cli/commands/cleanup.ts +120 -0
- package/src/modules/cli/commands/resume.ts +156 -0
- package/src/modules/cli/commands/run.ts +322 -0
- package/src/modules/cli/commands/status.ts +101 -0
- package/src/modules/cli/index.ts +29 -0
- package/src/modules/cli/output.ts +256 -0
- package/src/modules/cli/shutdown.ts +122 -0
- package/src/modules/dashboard/__tests__/api-routes.test.ts +204 -0
- package/src/modules/dashboard/__tests__/file-watcher.test.ts +34 -0
- package/src/modules/dashboard/__tests__/server.test.ts +120 -0
- package/src/modules/dashboard/__tests__/sse-broadcaster.test.ts +163 -0
- package/src/modules/dashboard/__tests__/sse-routes.test.ts +58 -0
- package/src/modules/dashboard/__tests__/state-aggregator.test.ts +330 -0
- package/src/modules/dashboard/index.ts +8 -0
- package/src/modules/dashboard/routes/api.ts +84 -0
- package/src/modules/dashboard/routes/sse.ts +37 -0
- package/src/modules/dashboard/server.ts +111 -0
- package/src/modules/dashboard/services/file-watcher.ts +36 -0
- package/src/modules/dashboard/services/sse-broadcaster.ts +81 -0
- package/src/modules/dashboard/services/state-aggregator.ts +132 -0
- package/src/modules/dashboard/ui/dashboard.html +405 -0
- package/src/modules/git-workspace/__tests__/branch-manager.test.ts +335 -0
- package/src/modules/git-workspace/__tests__/git-exec.test.ts +91 -0
- package/src/modules/git-workspace/__tests__/memory-sync.test.ts +273 -0
- package/src/modules/git-workspace/__tests__/merge-service.test.ts +286 -0
- package/src/modules/git-workspace/__tests__/settings-merge.test.ts +163 -0
- package/src/modules/git-workspace/__tests__/worktree-manager.test.ts +247 -0
- package/src/modules/git-workspace/branch-manager.ts +191 -0
- package/src/modules/git-workspace/git-exec.ts +124 -0
- package/src/modules/git-workspace/index.ts +17 -0
- package/src/modules/git-workspace/memory-sync.ts +89 -0
- package/src/modules/git-workspace/merge-service.ts +156 -0
- package/src/modules/git-workspace/settings-merge.ts +95 -0
- package/src/modules/git-workspace/worktree-manager.ts +199 -0
- package/src/modules/logging/__tests__/log-store.test.ts +242 -0
- package/src/modules/logging/__tests__/logger.test.ts +81 -0
- package/src/modules/logging/__tests__/sse-transport.test.ts +93 -0
- package/src/modules/logging/index.ts +7 -0
- package/src/modules/logging/log-store.ts +80 -0
- package/src/modules/logging/logger.ts +55 -0
- package/src/modules/logging/transports/sse-transport.ts +28 -0
- package/src/modules/multi-repo/__tests__/multi-repo-planner.test.ts +93 -0
- package/src/modules/multi-repo/__tests__/repo-context.test.ts +79 -0
- package/src/modules/multi-repo/index.ts +12 -0
- package/src/modules/multi-repo/multi-repo-planner.ts +112 -0
- package/src/modules/multi-repo/repo-context.ts +71 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-81991/progress.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-81991/queue/completed/task-getall-2.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-81991/queue/pending/task-1.json +13 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-81991/queue/pending/task-getall-1.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-81991/queue/pending/task-status-change.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-81991/workers/worker-1.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-81991/workers/worker-2.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-82469/progress.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-82469/queue/completed/task-getall-2.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-82469/queue/pending/task-1.json +13 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-82469/queue/pending/task-getall-1.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-82469/queue/pending/task-status-change.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-82469/workers/worker-1.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-82469/workers/worker-2.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85301/progress.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85301/queue/completed/task-getall-2.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85301/queue/pending/task-1.json +13 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85301/queue/pending/task-getall-1.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85301/queue/pending/task-status-change.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85301/workers/worker-1.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85301/workers/worker-2.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85759/progress.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85759/queue/completed/task-getall-2.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85759/queue/pending/task-1.json +13 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85759/queue/pending/task-getall-1.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85759/queue/pending/task-status-change.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85759/workers/worker-1.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-85759/workers/worker-2.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-86184/progress.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-86184/queue/completed/task-getall-2.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-86184/queue/pending/task-1.json +13 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-86184/queue/pending/task-getall-1.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-86184/queue/pending/task-status-change.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-86184/workers/worker-1.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-86184/workers/worker-2.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-88026/progress.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-88026/queue/completed/task-getall-2.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-88026/queue/pending/task-1.json +13 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-88026/queue/pending/task-getall-1.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-88026/queue/pending/task-status-change.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-88026/workers/worker-1.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-88026/workers/worker-2.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89475/progress.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89475/queue/completed/task-getall-2.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89475/queue/pending/task-1.json +13 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89475/queue/pending/task-getall-1.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89475/queue/pending/task-status-change.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89475/workers/worker-1.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89475/workers/worker-2.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89924/progress.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89924/queue/completed/task-getall-2.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89924/queue/pending/task-1.json +13 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89924/queue/pending/task-getall-1.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89924/queue/pending/task-status-change.json +10 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89924/workers/worker-1.json +5 -0
- package/src/modules/persistence/__tests__/.tmp-stores-test-89924/workers/worker-2.json +5 -0
- package/src/modules/persistence/__tests__/file-lock.test.ts +141 -0
- package/src/modules/persistence/__tests__/index.test.ts +38 -0
- package/src/modules/persistence/__tests__/stores.test.ts +594 -0
- package/src/modules/persistence/file-lock.ts +158 -0
- package/src/modules/persistence/fs-run-store.ts +73 -0
- package/src/modules/persistence/fs-task-store.ts +152 -0
- package/src/modules/persistence/fs-worker-store.ts +116 -0
- package/src/modules/persistence/in-memory-stores.ts +98 -0
- package/src/modules/persistence/index.ts +60 -0
- package/src/modules/persistence/stores.port.ts +60 -0
- package/src/modules/planning/__tests__/file-conflict-validator.test.ts +256 -0
- package/src/modules/planning/__tests__/planning-service.test.ts +366 -0
- package/src/modules/planning/__tests__/project-detection.test.ts +707 -0
- package/src/modules/planning/file-conflict-validator.ts +135 -0
- package/src/modules/planning/index.ts +40 -0
- package/src/modules/planning/planning.service.ts +262 -0
- package/src/modules/planning/project-detection.ts +525 -0
- package/src/modules/plugin/__tests__/plugin-loader.test.ts +83 -0
- package/src/modules/plugin/__tests__/plugin-manager.test.ts +187 -0
- package/src/modules/plugin/index.ts +3 -0
- package/src/modules/plugin/plugin-loader.ts +46 -0
- package/src/modules/plugin/plugin-manager.ts +90 -0
- package/src/modules/plugin/plugin.types.ts +37 -0
- package/src/modules/process-manager/__tests__/process-manager.test.ts +210 -0
- package/src/modules/process-manager/__tests__/worker.test.ts +89 -0
- package/src/modules/process-manager/index.ts +5 -0
- package/src/modules/process-manager/process-manager.ts +193 -0
- package/src/modules/process-manager/worker.ts +106 -0
- package/src/modules/task-execution/__tests__/default-spawner.test.ts +154 -0
- package/src/modules/task-execution/__tests__/executor.test.ts +760 -0
- package/src/modules/task-execution/__tests__/implementer-green.test.ts +286 -0
- package/src/modules/task-execution/__tests__/merge-phase.test.ts +368 -0
- package/src/modules/task-execution/__tests__/reviewer.test.ts +302 -0
- package/src/modules/task-execution/__tests__/tester-red.test.ts +281 -0
- package/src/modules/task-execution/__tests__/tester-verify.test.ts +313 -0
- package/src/modules/task-execution/executor.ts +303 -0
- package/src/modules/task-execution/index.ts +45 -0
- package/src/modules/task-execution/phases/default-spawner.ts +49 -0
- package/src/modules/task-execution/phases/implementer-green.ts +100 -0
- package/src/modules/task-execution/phases/merge.ts +122 -0
- package/src/modules/task-execution/phases/reviewer.ts +160 -0
- package/src/modules/task-execution/phases/tester-red.ts +100 -0
- package/src/modules/task-execution/phases/tester-verify.ts +120 -0
- package/src/modules/task-queue/__tests__/dependency-resolver.test.ts +456 -0
- package/src/modules/task-queue/__tests__/dispatcher.test.ts +824 -0
- package/src/modules/task-queue/__tests__/task-plan.test.ts +122 -0
- package/src/modules/task-queue/__tests__/task.test.ts +130 -0
- package/src/modules/task-queue/dependency-resolver.ts +171 -0
- package/src/modules/task-queue/dispatcher.ts +372 -0
- package/src/modules/task-queue/index.ts +16 -0
- package/src/modules/task-queue/task-plan.ts +40 -0
- package/src/modules/task-queue/task.ts +67 -0
- package/src/shared/__tests__/config.test.ts +204 -0
- package/src/shared/__tests__/errors.test.ts +285 -0
- package/src/shared/__tests__/events.test.ts +496 -0
- package/src/shared/__tests__/types.test.ts +360 -0
- package/src/shared/config.ts +133 -0
- package/src/shared/errors.ts +128 -0
- package/src/shared/events.ts +171 -0
- package/src/shared/types.ts +143 -0
- package/tsconfig.json +30 -0
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { describe, test, expect, beforeEach, afterEach } from "bun:test";
|
|
2
|
+
import { rm, mkdir } from "node:fs/promises";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { FileLock, withFileLock } from "../file-lock";
|
|
5
|
+
import { FileLockError } from "@aad/shared/errors";
|
|
6
|
+
|
|
7
|
+
const TEST_DIR = join(import.meta.dir, ".tmp-file-lock-test");
|
|
8
|
+
|
|
9
|
+
describe("FileLock", () => {
|
|
10
|
+
beforeEach(async () => {
|
|
11
|
+
await rm(TEST_DIR, { recursive: true, force: true });
|
|
12
|
+
await mkdir(TEST_DIR, { recursive: true });
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
afterEach(async () => {
|
|
16
|
+
await rm(TEST_DIR, { recursive: true, force: true });
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
test("acquires and releases lock successfully", async () => {
|
|
20
|
+
const lockDir = join(TEST_DIR, "test-lock");
|
|
21
|
+
const lock = new FileLock({ lockDir });
|
|
22
|
+
|
|
23
|
+
await lock.acquire();
|
|
24
|
+
await lock.release();
|
|
25
|
+
|
|
26
|
+
expect(true).toBe(true);
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
test("allows sequential lock acquisition", async () => {
|
|
30
|
+
const lockDir = join(TEST_DIR, "sequential-lock");
|
|
31
|
+
const lock1 = new FileLock({ lockDir });
|
|
32
|
+
const lock2 = new FileLock({ lockDir });
|
|
33
|
+
|
|
34
|
+
await lock1.acquire();
|
|
35
|
+
await lock1.release();
|
|
36
|
+
|
|
37
|
+
await lock2.acquire();
|
|
38
|
+
await lock2.release();
|
|
39
|
+
|
|
40
|
+
expect(true).toBe(true);
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test("detects and removes stale locks", async () => {
|
|
44
|
+
const lockDir = join(TEST_DIR, "stale-lock");
|
|
45
|
+
|
|
46
|
+
// Create a stale lock with non-existent PID
|
|
47
|
+
await mkdir(lockDir);
|
|
48
|
+
await Bun.write(join(lockDir, "pid"), "999999");
|
|
49
|
+
|
|
50
|
+
const lock = new FileLock({ lockDir });
|
|
51
|
+
await lock.acquire();
|
|
52
|
+
await lock.release();
|
|
53
|
+
|
|
54
|
+
expect(true).toBe(true);
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
test("withFileLock helper auto-releases", async () => {
|
|
58
|
+
const lockDir = join(TEST_DIR, "helper-lock");
|
|
59
|
+
let executed = false;
|
|
60
|
+
|
|
61
|
+
await withFileLock({ lockDir }, async () => {
|
|
62
|
+
executed = true;
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
expect(executed).toBe(true);
|
|
66
|
+
|
|
67
|
+
// Lock should be released, can acquire again
|
|
68
|
+
const lock = new FileLock({ lockDir });
|
|
69
|
+
await lock.acquire();
|
|
70
|
+
await lock.release();
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
test("withFileLock releases on error", async () => {
|
|
74
|
+
const lockDir = join(TEST_DIR, "error-lock");
|
|
75
|
+
|
|
76
|
+
await expect(
|
|
77
|
+
withFileLock({ lockDir }, async () => {
|
|
78
|
+
throw new Error("Test error");
|
|
79
|
+
})
|
|
80
|
+
).rejects.toThrow("Test error");
|
|
81
|
+
|
|
82
|
+
// Lock should still be released
|
|
83
|
+
const lock = new FileLock({ lockDir });
|
|
84
|
+
await lock.acquire();
|
|
85
|
+
await lock.release();
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
test("forceRelease removes lock unconditionally", async () => {
|
|
89
|
+
const lockDir = join(TEST_DIR, "force-lock");
|
|
90
|
+
const lock1 = new FileLock({ lockDir });
|
|
91
|
+
const lock2 = new FileLock({ lockDir });
|
|
92
|
+
|
|
93
|
+
await lock1.acquire();
|
|
94
|
+
await lock2.forceRelease();
|
|
95
|
+
|
|
96
|
+
// Lock should be removable after force release
|
|
97
|
+
await lock1.acquire(); // Should not fail
|
|
98
|
+
await lock1.release();
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
test("acquire throws FileLockError on non-EEXIST mkdir failure", async () => {
|
|
102
|
+
// Use a path that cannot be created (nested under a file, not a directory)
|
|
103
|
+
const blockerFile = join(TEST_DIR, "blocker");
|
|
104
|
+
await Bun.write(blockerFile, "not-a-dir");
|
|
105
|
+
const lockDir = join(blockerFile, "impossible-lock");
|
|
106
|
+
|
|
107
|
+
const lock = new FileLock({ lockDir, timeout: 500, retryInterval: 50 });
|
|
108
|
+
|
|
109
|
+
await expect(lock.acquire()).rejects.toThrow(FileLockError);
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
test("forceRelease handles missing lock dir gracefully", async () => {
|
|
113
|
+
const lockDir = join(TEST_DIR, "missing-force-lock");
|
|
114
|
+
const lock = new FileLock({ lockDir });
|
|
115
|
+
// Should not throw even if dir doesn't exist
|
|
116
|
+
await lock.forceRelease();
|
|
117
|
+
});
|
|
118
|
+
|
|
119
|
+
test("release is no-op when not acquired", async () => {
|
|
120
|
+
const lockDir = join(TEST_DIR, "noop-release");
|
|
121
|
+
const lock = new FileLock({ lockDir });
|
|
122
|
+
|
|
123
|
+
// Should not throw
|
|
124
|
+
await lock.release();
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
test("treats non-numeric PID as stale lock", async () => {
|
|
128
|
+
const lockDir = join(TEST_DIR, "bad-pid-lock");
|
|
129
|
+
|
|
130
|
+
// Create lock with non-numeric PID
|
|
131
|
+
await mkdir(lockDir);
|
|
132
|
+
await Bun.write(join(lockDir, "pid"), "not-a-number");
|
|
133
|
+
|
|
134
|
+
const lock = new FileLock({ lockDir });
|
|
135
|
+
// Should treat as stale and acquire successfully
|
|
136
|
+
await lock.acquire();
|
|
137
|
+
await lock.release();
|
|
138
|
+
|
|
139
|
+
expect(true).toBe(true);
|
|
140
|
+
});
|
|
141
|
+
});
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { describe, test, expect } from "bun:test";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { rm, mkdir } from "node:fs/promises";
|
|
4
|
+
import { createStores } from "../index";
|
|
5
|
+
|
|
6
|
+
const TEST_DIR = join(import.meta.dir, `.tmp-index-test-${process.pid}`);
|
|
7
|
+
|
|
8
|
+
describe("createStores factory", () => {
|
|
9
|
+
test('createStores("memory") returns InMemory stores', () => {
|
|
10
|
+
const stores = createStores("memory");
|
|
11
|
+
expect(stores.taskStore).toBeDefined();
|
|
12
|
+
expect(stores.workerStore).toBeDefined();
|
|
13
|
+
expect(stores.runStore).toBeDefined();
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test('createStores("fs", { basePath }) returns FS stores', async () => {
|
|
17
|
+
await rm(TEST_DIR, { recursive: true, force: true });
|
|
18
|
+
await mkdir(TEST_DIR, { recursive: true });
|
|
19
|
+
|
|
20
|
+
try {
|
|
21
|
+
const stores = createStores("fs", { basePath: TEST_DIR });
|
|
22
|
+
expect(stores.taskStore).toBeDefined();
|
|
23
|
+
expect(stores.workerStore).toBeDefined();
|
|
24
|
+
expect(stores.runStore).toBeDefined();
|
|
25
|
+
} finally {
|
|
26
|
+
await rm(TEST_DIR, { recursive: true, force: true });
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
|
|
30
|
+
test('createStores("fs") without basePath throws Error', () => {
|
|
31
|
+
expect(() => createStores("fs")).toThrow("basePath is required for fs mode");
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
test('createStores with unknown mode throws Error', () => {
|
|
35
|
+
// @ts-expect-error testing invalid mode
|
|
36
|
+
expect(() => createStores("unknown")).toThrow("Unknown store mode: unknown");
|
|
37
|
+
});
|
|
38
|
+
});
|