index.js 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. var __defProp = Object.defineProperty;
  2. var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
  3. var __getOwnPropNames = Object.getOwnPropertyNames;
  4. var __hasOwnProp = Object.prototype.hasOwnProperty;
  5. var __export = (target, all) => {
  6. for (var name in all)
  7. __defProp(target, name, { get: all[name], enumerable: true });
  8. };
  9. var __copyProps = (to, from, except, desc) => {
  10. if (from && typeof from === "object" || typeof from === "function") {
  11. for (let key of __getOwnPropNames(from))
  12. if (!__hasOwnProp.call(to, key) && key !== except)
  13. __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  14. }
  15. return to;
  16. };
  17. var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
  18. var testing_exports = {};
  19. __export(testing_exports, {
  20. testClient: () => testClient
  21. });
  22. module.exports = __toCommonJS(testing_exports);
  23. var import_client = require("../../client");
  24. const testClient = (app, Env, executionCtx, options) => {
  25. const customFetch = (input, init) => {
  26. return app.request(input, init, Env, executionCtx);
  27. };
  28. return (0, import_client.hc)("http://localhost", { ...options, fetch: customFetch });
  29. };
  30. // Annotate the CommonJS export names for ESM import in node:
  31. 0 && (module.exports = {
  32. testClient
  33. });