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
27 lines
698 B
TypeScript
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."
|
|
);
|
|
});
|
|
});
|