Files
wehub-resource-sync 70bf21e064
Handle Changesets / Handle Changesets (push) Waiting to run
Semgrep OSS scan / semgrep-oss (push) Waiting to run
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
chore: import upstream snapshot with attribution
2026-07-13 12:30:11 +08:00

27 lines
698 B
TypeScript

import { execSync } from "node:child_process";
import { resolve } from "node:path";
import { assert, describe, it } from "vitest";
describe("durable objects", () => {
it("should throw an error when the worker doesn't export a durable object but requires one", ({
expect,
}) => {
let err: string = "";
try {
execSync("pnpm run dev", {
cwd: resolve(__dirname, ".."),
});
assert(false); // Should never reach this
} catch (e) {
err = (e as Error).message
.replaceAll("✘", "X")
.replace(/\\/g, "/")
.replace(/[^\S\n]+\n/g, "\n")
.trimEnd();
}
expect(err).toContain(
"You should export these objects from your entrypoint, src/index.js."
);
});
});