From 8c1993d39a121a5ad270828ad89b4f5385123d20 Mon Sep 17 00:00:00 2001 From: Alexander Zinn Date: Thu, 4 Sep 2025 20:27:27 -0400 Subject: [PATCH] maintenance --- bunfig.toml | 3 +++ package.json | 6 ++++++ src/apis/Channels.ts | 6 ++++-- src/net/http/HttpMethod.ts | 4 +++- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/bunfig.toml b/bunfig.toml index ae22d90..5ff8379 100644 --- a/bunfig.toml +++ b/bunfig.toml @@ -3,3 +3,6 @@ save = false [install.scopes] "@techniker-me" = "https://registry-node.techniker.me" + +[test] +preload = ["./test/setup.ts"] diff --git a/package.json b/package.json index f2f3b9a..165605f 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,14 @@ "scripts": { "ci-build": "bun run build", "test": "bun test", + "test:unit": "bun test test/unit", + "test:integration": "bun test test/integration", "test:watch": "bun test --watch", + "test:watch:unit": "bun test --watch test/unit", + "test:watch:integration": "bun test --watch test/integration", "test:coverage": "bun test --coverage", + "test:coverage:unit": "bun test --coverage test/unit", + "test:coverage:integration": "bun test --coverage test/integration", "preformat": "bun install", "format": "prettier --write ./", "prelint:fix": "bun format", diff --git a/src/apis/Channels.ts b/src/apis/Channels.ts index 2048fe9..3bc83b1 100644 --- a/src/apis/Channels.ts +++ b/src/apis/Channels.ts @@ -50,9 +50,11 @@ export class Channels { private readonly _httpRequests: PCastHttpRequests; private readonly _channelsByAlias: Map = new Map(); - constructor(pcastHttpRequests: PCastHttpRequests) { + constructor(pcastHttpRequests: PCastHttpRequests, skipInitialization = false) { this._httpRequests = pcastHttpRequests; - this.initialize(); + if (!skipInitialization) { + this.initialize(); + } } public async create(name: string, description: string, channelOptions: string[] = []): Promise { diff --git a/src/net/http/HttpMethod.ts b/src/net/http/HttpMethod.ts index 2d48a2e..8dcf9ae 100644 --- a/src/net/http/HttpMethod.ts +++ b/src/net/http/HttpMethod.ts @@ -3,5 +3,7 @@ export enum HttpMethod { POST = 'POST', PUT = 'PUT', PATCH = 'PATCH', - DELETE = 'DELETE' + DELETE = 'DELETE', + OPTIONS = 'OPTIONS', + HEAD = 'HEAD' }