Files
wehub-resource-sync 70bf21e064
Deploy (to testing) and Test Playground Preview Worker / Deploy Playground Preview Worker (testing) (push) Has been skipped
Deploy Workers Shared Staging / Deploy Workers Shared Staging (push) Failing after 0s
Prerelease / build (push) Has been skipped
Handle Changesets / Handle Changesets (push) Has been cancelled
Semgrep OSS scan / semgrep-oss (push) Has been cancelled
chore: import upstream snapshot with attribution
2026-07-13 12:30:11 +08:00

36 lines
1.2 KiB
TypeScript

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);
});
});
});