Skip to content

Commit

Permalink
Merge pull request #44 from ubiquity-whilefoo/urgent-fix
Browse files Browse the repository at this point in the history
fix: tests, formatting, delete bun.lockb
  • Loading branch information
whilefoo authored Feb 13, 2025
2 parents 29186a4 + 70bad85 commit 2abba30
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@ Command Wallet is built as a serverless application using Cloudflare Workers, wi
### Key Components

#### 1. Worker (src/worker.ts)

- Entry point for the Cloudflare Worker
- Handles incoming HTTP requests
- Processes GitHub webhook events
- Manages environment variables and context

#### 2. Command Parser (src/handlers/command-parser.ts)

- Parses commands from GitHub comments
- Supports commands like:
- Adding wallets
Expand All @@ -26,6 +28,7 @@ Command Wallet is built as a serverless application using Cloudflare Workers, wi
- Validates command syntax and parameters

#### 3. Plugin System (src/plugin.ts)

- Provides extensibility through plugins
- Plugins can:
- Process commands
Expand All @@ -37,6 +40,7 @@ Command Wallet is built as a serverless application using Cloudflare Workers, wi
- Context management

#### 4. Database Layer (src/adapters/supabase)

- Uses Supabase as the PostgreSQL database provider
- Schema includes:
- Wallet addresses
Expand All @@ -48,6 +52,7 @@ Command Wallet is built as a serverless application using Cloudflare Workers, wi
- Query operations

#### 5. Testing Infrastructure

- Jest-based test suite
- Mock data and handlers for:
- Database operations
Expand Down
Binary file removed bun.lockb
Binary file not shown.
4 changes: 4 additions & 0 deletions tests/main.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { afterAll, afterEach, beforeAll, beforeEach, describe, expect, it, jest } from "@jest/globals";
import { drop } from "@mswjs/data";
import { Octokit } from "@octokit/rest";
import { CommentHandler } from "@ubiquity-os/plugin-sdk";
import { Logs } from "@ubiquity-os/ubiquity-os-logger";
import { ethers } from "ethers";
import { plugin } from "../src/plugin";
Expand Down Expand Up @@ -66,6 +67,7 @@ describe("Wallet command tests", () => {
SUPABASE_KEY: process.env.SUPABASE_KEY,
},
logger: new Logs("debug"),
commentHandler: new CommentHandler(),
} as unknown as Context;
await plugin(context);
expect(spy).toHaveBeenCalledTimes(1);
Expand Down Expand Up @@ -102,6 +104,7 @@ describe("Wallet command tests", () => {
SUPABASE_KEY: process.env.SUPABASE_KEY,
},
logger: new Logs("debug"),
commentHandler: new CommentHandler(),
} as unknown as Context;
await plugin(context);
expect(spy).toHaveBeenCalledTimes(1);
Expand Down Expand Up @@ -133,6 +136,7 @@ describe("Wallet command tests", () => {
SUPABASE_KEY: process.env.SUPABASE_KEY,
},
logger: new Logs("info"),
commentHandler: new CommentHandler(),
} as unknown as Context);
expect(spy).toHaveBeenCalledTimes(1);
expect(spy).toHaveBeenLastCalledWith("Successfully unset wallet");
Expand Down

0 comments on commit 2abba30

Please sign in to comment.