e5e6de2fad
- Replace bun:test with vitest across all packages - Replace bun build with esbuild - Replace bun:sqlite with better-sqlite3 - Fix OCAS Store API: store.put/get → store.cas.put/get - Fix vitest vi.mock hoisting (vi.hoisted) - Add pnpm-workspace.yaml and pnpm-lock.yaml - Update all package.json test/build scripts WIP: 8 failures remain in agent-hermes (bun engines check + sqlite migration) Refs #26
31 lines
1.2 KiB
TypeScript
31 lines
1.2 KiB
TypeScript
import { describe, expect, test } from 'vitest';
|
|
import { dirname } from 'node:path';
|
|
import { fileURLToPath } from 'node:url';
|
|
import { readFileSync } from "node:fs";
|
|
import { join } from "node:path";
|
|
|
|
const PKG_ROOT = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
|
|
describe("Issue #551 — bin entry & engines", () => {
|
|
test("package.json declares bun in engines", () => {
|
|
const pkg = JSON.parse(readFileSync(join(PKG_ROOT, "package.json"), "utf-8"));
|
|
expect(pkg.engines).toBeDefined();
|
|
expect(pkg.engines.bun).toBeDefined();
|
|
expect(pkg.engines.bun).toMatch(/^>=?\s*[\d.]+/);
|
|
});
|
|
|
|
test("bin entry file has bun shebang", () => {
|
|
const pkg = JSON.parse(readFileSync(join(PKG_ROOT, "package.json"), "utf-8"));
|
|
const binPath = pkg.bin["uwf-hermes"];
|
|
const content = readFileSync(join(PKG_ROOT, binPath), "utf-8");
|
|
expect(content.startsWith("#!/usr/bin/env bun")).toBe(true);
|
|
});
|
|
|
|
test("README.md explains uwf-hermes is an adapter", () => {
|
|
const readme = readFileSync(join(PKG_ROOT, "README.md"), "utf-8");
|
|
expect(readme.toLowerCase()).toContain("adapter");
|
|
expect(readme).toMatch(/uwf-hermes/);
|
|
expect(readme).toMatch(/hermes/);
|
|
});
|
|
});
|