import { afterEach, describe, expect, it } from "vitest"; import { createCapabilityContext } from "./context.js"; afterEach(() => { delete process.env.NOTION_API_TOKEN; delete process.env.NOTION_WORKFLOW_STEP_DIRECTORY; }); describe("createCapabilityContext", () => { it("explains how to configure local Notion API access", () => { const context = createCapabilityContext(); expect(() => context.notion.pages).toThrow( "NOTION_API_TOKEN is not set. context.notion requires an API token when an app capability runs locally.", ); }); it("explains how to grant deployed workflow access", () => { process.env.NOTION_WORKFLOW_STEP_DIRECTORY = "/tmp/notion-run/steps"; const context = createCapabilityContext(); expect(() => context.notion.pages).toThrow( "Notion API access is not configured for this deployed workflow. In Notion, open Developer Tools → Workers", ); }); });