Docs menu

Overview

channelstack tests the apps and agents you build for Slack, GitHub, Linear, Notion, Resend, Gmail and Discord: a Slack bot, a GitHub App, a Linear or Notion integration, an agent people email, a Discord bot, a notification bot, or an AI agent. It runs those platforms as fakes on your machine, and OpenAI's API for your agent's model, so a test can play the people in a conversation and check what they would see.

import { expect, test } from "vitest";test("a mention gets exactly one reply, in the thread", async ({ slack }) => {  const ana = await slack.createUser({ name: "Ana" });  const channel = await slack.createChannel({ participants: [ana, slack.app] });  const msg = await ana.say("@my-agent summarize yesterday's incidents", { channel });  await expect(msg.thread).toHaveReplyFrom("my-agent", { text: /incident/i });  await expect(msg.thread).toHaveRepliesFrom(slack.app, { count: 1 });  await expect(channel).not.toHaveChannelMessageFrom("my-agent");});

The test never touches your app. Ana's message goes into a fake Slack workspace, which delivers the event to your app the way Slack would. Your app answers through the Slack SDK it already uses, pointed at the fake. The matchers then read the thread.

  1. The test acts as Ana: she mentions the app in a channel.
  2. The fake Slack delivers the event to your app, signed, the way Slack does.
  3. Your app answers through the Slack API it already uses, which now points at the fake.
  4. The matcher reads the thread as Ana would see it, and passes.

What you get#

  • Fakes of seven platforms on localhost: Slack, GitHub, Linear, Notion, Resend, Google (Gmail) and Discord, with their real APIs, webhooks, signatures, ids and error codes. Your app runs unchanged; one environment variable per platform points it at the fake.
  • A fake model for AI agents. OpenAI's API at openai.localhost, scripted per test: text, streams, tool calls, errors and a slow first token, images, audio, files and OpenAI's built-in tools. Anything that takes an OpenAI base URL works, from the openai SDKs and the AI SDK to OpenRouter and Azure OpenAI. See OpenAI.
  • Tests that read like the conversation. Every action belongs to the person who takes it (ana.say(…), ben.click("Approve", …), mo.comment(…)), and every check is about what a person would see.
  • Checks that wait for your app. Replies arrive when they arrive. Positive checks wait until they hold; negative and exact-count checks wait until the app has gone quiet. A test never sleeps.
  • The failures that matter, on demand. Slack's 3-second retry, redelivered webhooks, bad signatures, rate limits and dropped sockets, so you can test what happens on a bad day.
  • The same test against the real platforms. With sandbox credentials in the environment, a test acts on a real workspace and reads the result back. It runs on the fakes for every pull request and live at night.
  • Vitest and pytest. channelstack plugs into the test framework you already use, with fixtures and matchers. There are SDKs for TypeScript, Python and Rust, an attach CLI and an MCP server for coding agents.

What it doesn't do#

  • It doesn't run your app. You start the app as usual. channelstack env prints the variables it needs.
  • It doesn't write your model's answers. The fake OpenAI says what each test scripted, and never judges an answer. An agent that doesn't use it keeps its framework's fake model (the AI SDK's MockLanguageModelV4, LangChain's FakeListChatModel, …) or a real one. The matchers check how the agent behaved, not the exact words.
  • It isn't a pixel copy of each product. The UI shows the conversations people have with your app as the same transcript the matchers read, next to every delivery and API call behind them.

Where to go next#

If you want toRead
Know why this exists, and how it differs from mocking the SDKWhy channelstack
Get a first test passing in ten minutesGetting started
Understand the piecesHow it works
Connect your own appConnecting your app
Script what your agent's model answersOpenAI
Look something upSlack API, Matchers, CLI

Suggest changes to this page