File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { Absurd } from "absurd-sdk" ;
22import { Database } from "bun:sqlite" ;
3+ import type { AbsurdClient } from "@absurd-sqlite/sdk" ;
34
45import { BunSqliteConnection } from "./sqlite" ;
56
7+ export type { AbsurdClient } from "@absurd-sqlite/sdk" ;
8+
69/**
710 * Register tasks and perform any one-time setup before the worker starts.
811 */
9- export type SetupFunction = ( absurd : Absurd ) => void | Promise < void > ;
12+ export type SetupFunction = ( absurd : AbsurdClient ) => void | Promise < void > ;
1013
1114/**
1215 * Boots a worker using Bun's SQLite driver and Absurd's task engine.
@@ -15,9 +18,7 @@ export type SetupFunction = (absurd: Absurd) => void | Promise<void>;
1518 * - ABSURD_DATABASE_PATH: SQLite database file path.
1619 * - ABSURD_DATABASE_EXTENSION_PATH: Absurd-SQLite extension path (libabsurd.*).
1720 */
18- export default async function run (
19- setupFunction : SetupFunction
20- ) : Promise < void > {
21+ export default async function run ( setupFunction : SetupFunction ) : Promise < void > {
2122 const dbPath = process . env . ABSURD_DATABASE_PATH ;
2223 const extensionPath = process . env . ABSURD_DATABASE_EXTENSION_PATH ;
2324
Original file line number Diff line number Diff line change @@ -57,10 +57,13 @@ afterEach(() => {
5757
5858describe ( "run" , ( ) => {
5959 it ( "requires ABSURD_DATABASE_PATH" , async ( ) => {
60+ process . env . ABSURD_DATABASE_PATH = "" ;
6061 process . env . ABSURD_DATABASE_EXTENSION_PATH = extensionPath ;
6162 const { default : run } = await import ( "../src/index" ) ;
6263
63- await expect ( run ( ( ) => { } ) ) . rejects . toThrow ( "ABSURD_DATABASE_PATH is required" ) ;
64+ await expect ( run ( ( ) => { } ) ) . rejects . toThrow (
65+ "ABSURD_DATABASE_PATH is required"
66+ ) ;
6467 } ) ;
6568
6669 it ( "requires ABSURD_DATABASE_EXTENSION_PATH" , async ( ) => {
You can’t perform that action at this time.
0 commit comments