import { resolve } from "node:path"; import { describe, test } from "vitest"; import { WranglerE2ETestHelper } from "../helpers/e2e-wrangler-test"; describe("wrangler setup", () => { describe("run on a hono project", () => { test("detects when a hono app is already configured for Cloudflare", async ({ expect, }) => { const helper = new WranglerE2ETestHelper(); await helper.seed(resolve(__dirname, "./fixtures/hono-cf-workers-app")); const { status, stdout } = await helper.run("wrangler setup --yes"); expect(stdout).toContain( "🎉 Your project is already setup to deploy to Cloudflare" ); expect(status).toBe(0); }); test("errors for a hono app that is not configured for Cloudflare, mentioning that auto-configuring it is not supported", async ({ expect, }) => { const helper = new WranglerE2ETestHelper(); await helper.seed(resolve(__dirname, "./fixtures/hono-nodejs-app")); const { status, stderr } = await helper.run("wrangler setup --yes"); expect(stderr).toContain( '[ERROR] The detected framework ("Hono") cannot be automatically configured.' ); expect(status).not.toBe(0); }); }); });