From c6219ee391a2adf6cc2e6d466268022a15351e32 Mon Sep 17 00:00:00 2001 From: Sawyer Cutler Date: Fri, 25 Sep 2026 07:30:26 -0700 Subject: [PATCH] Move live-helper unit tests to tests/unit bun test ran three files from tests/live while skipping the e2e suites beside them. The helper tests now live in tests/unit, the test script runs that directory, and tests/live holds only the live e2e suites and their helpers. Both typechecks now cover tests/unit, and CI runs the package test script instead of bare bun test, which ignored it. --- .github/workflows/ci.yml | 2 +- package.json | 2 +- tests/{live => unit}/credential.test.ts | 4 ++-- tests/{live => unit}/fixtures.test.ts | 2 +- tests/{live => unit}/oauth.test.ts | 2 +- tsconfig.live.json | 2 +- tsconfig.typecheck.json | 3 ++- 7 files changed, 9 insertions(+), 8 deletions(-) rename tests/{live => unit}/credential.test.ts (94%) rename tests/{live => unit}/fixtures.test.ts (96%) rename tests/{live => unit}/oauth.test.ts (98%) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 593dd0e..a0e9994 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: - uses: oven-sh/setup-bun@v2 - run: bun install --frozen-lockfile - run: bun run typecheck - - run: bun test + - run: bun run test - run: bun run build - name: node smoke run: | diff --git a/package.json b/package.json index 2e8cf13..297afd4 100644 --- a/package.json +++ b/package.json @@ -60,7 +60,7 @@ "typecheck:live": "tsc -p tsconfig.live.json --noEmit", "build": "rm -rf dist && tsc -p tsconfig.build.json", "prepack": "bun run build", - "test": "bun test src tests/live/credential.test.ts tests/live/fixtures.test.ts tests/live/oauth.test.ts", + "test": "bun test src tests/unit", "test:live": "bun test tests/live" }, "peerDependencies": { diff --git a/tests/live/credential.test.ts b/tests/unit/credential.test.ts similarity index 94% rename from tests/live/credential.test.ts rename to tests/unit/credential.test.ts index 90dead1..43ec1c5 100644 --- a/tests/live/credential.test.ts +++ b/tests/unit/credential.test.ts @@ -1,7 +1,7 @@ import { describe, expect, test } from "bun:test"; -import { createStandaloneGmailCredential } from "./credential.js"; -import { type GmailOAuthConfig } from "./oauth.js"; +import { createStandaloneGmailCredential } from "../live/credential.js"; +import { type GmailOAuthConfig } from "../live/oauth.js"; const config: GmailOAuthConfig = { clientId: "client-id", diff --git a/tests/live/fixtures.test.ts b/tests/unit/fixtures.test.ts similarity index 96% rename from tests/live/fixtures.test.ts rename to tests/unit/fixtures.test.ts index 27a815f..6ef5799 100644 --- a/tests/live/fixtures.test.ts +++ b/tests/unit/fixtures.test.ts @@ -1,7 +1,7 @@ import { expect, test } from "bun:test"; import type { GmailTools } from "../../src/tools/create-tools.js"; -import { findGmailFixture } from "./fixtures.js"; +import { findGmailFixture } from "../live/fixtures.js"; test("findGmailFixture uses the Gmail tool argument contract", async () => { let call: diff --git a/tests/live/oauth.test.ts b/tests/unit/oauth.test.ts similarity index 98% rename from tests/live/oauth.test.ts rename to tests/unit/oauth.test.ts index f555516..2954a18 100644 --- a/tests/live/oauth.test.ts +++ b/tests/unit/oauth.test.ts @@ -1,6 +1,6 @@ import { describe, expect, test } from "bun:test"; -import { readGmailOAuthConfig, refreshGmailAccessToken } from "./oauth.js"; +import { readGmailOAuthConfig, refreshGmailAccessToken } from "../live/oauth.js"; describe("Gmail OAuth", () => { test("normalizes the required configuration", () => { diff --git a/tsconfig.live.json b/tsconfig.live.json index 05082ea..3e82553 100644 --- a/tsconfig.live.json +++ b/tsconfig.live.json @@ -3,5 +3,5 @@ "compilerOptions": { "types": ["node", "@types/bun"] }, - "include": ["src", "tests/live"] + "include": ["src", "tests/unit", "tests/live"] } diff --git a/tsconfig.typecheck.json b/tsconfig.typecheck.json index fc8520e..46d70da 100644 --- a/tsconfig.typecheck.json +++ b/tsconfig.typecheck.json @@ -1,3 +1,4 @@ { - "extends": "./tsconfig.json" + "extends": "./tsconfig.json", + "include": ["src", "tests/unit"] }