remoteBundleValidation.test.ts 683 B

12345678910111213141516171819202122
  1. import { describe, expect, it } from "vitest";
  2. import { validateRemoteServerBundle } from "../buildRemoteValidation.js";
  3. describe("remote server bundle validation", () => {
  4. it("allows bundles that do not depend on undici", () => {
  5. expect(() =>
  6. validateRemoteServerBundle({
  7. bundledInputs: ["src/entry-stdio.ts"],
  8. source: "console.log('remote server');",
  9. }),
  10. ).not.toThrow();
  11. });
  12. it("rejects unresolved runtime undici requires", () => {
  13. expect(() =>
  14. validateRemoteServerBundle({
  15. bundledInputs: ["src/entry-stdio.ts"],
  16. source: 'const undici = require("undici");',
  17. }),
  18. ).toThrow(/inline undici/);
  19. });
  20. });