test(server): build cron, trace and held-action stores on WaggleDB (P1.5)
These stores take Waggle's own database since ADR-0007; the tests still handed them a MindDB. Only the store construction changes.
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
import { describe, it, expect, beforeEach, afterEach, vi } from 'vitest';
|
||||
import Fastify from 'fastify';
|
||||
import { MindDB, CronStore } from '@waggle/core';
|
||||
import { WaggleDB, CronStore } from '@waggle/core';
|
||||
import { cronRoutes } from '../../src/local/routes/cron.js';
|
||||
|
||||
function createTestServer(store: CronStore) {
|
||||
@@ -20,7 +20,7 @@ function createTestServer(store: CronStore) {
|
||||
}
|
||||
|
||||
/** Insert a row with arbitrary (possibly corrupt) job_config directly. */
|
||||
function seedRow(db: MindDB, name: string, jobConfig: string): number {
|
||||
function seedRow(db: WaggleDB, name: string, jobConfig: string): number {
|
||||
const res = db.getDatabase().prepare(`
|
||||
INSERT INTO cron_schedules (name, cron_expr, job_type, job_config, workspace_id, enabled, next_run_at)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?)
|
||||
@@ -29,12 +29,12 @@ function seedRow(db: MindDB, name: string, jobConfig: string): number {
|
||||
}
|
||||
|
||||
describe('R1-008 — GET /api/cron corrupt job_config resilience', () => {
|
||||
let db: MindDB;
|
||||
let db: WaggleDB;
|
||||
let store: CronStore;
|
||||
let server: ReturnType<typeof Fastify>;
|
||||
|
||||
beforeEach(() => {
|
||||
db = new MindDB(':memory:');
|
||||
db = new WaggleDB(':memory:');
|
||||
store = new CronStore(db);
|
||||
server = createTestServer(store);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user