Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: update esbuild #6884

Merged
merged 10 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix middleware tests
  • Loading branch information
penalosa committed Nov 29, 2024
commit e0eec69980f1f9f49c4321edfecb1ff1f3eb5dab
4 changes: 2 additions & 2 deletions .github/workflows/test-and-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ jobs:
node_version: 18
# Do a limited test on other Node versions (limited because of CI capacity)
- os: ubuntu-latest
filter: "./packages"
filter: "./packages/*"
node_version: 20

- os: ubuntu-latest
filter: "./packages"
filter: "./packages/*"
node_version: 22

runs-on: ${{ matrix.os }}
Expand Down
19 changes: 10 additions & 9 deletions packages/wrangler/src/__tests__/middleware.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -872,9 +872,6 @@ describe("middleware", () => {
).toMatchInlineSnapshot(`
"var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, \\"name\\", { value, configurable: true });


var __defProp = Object.defineProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
Expand All @@ -892,13 +889,15 @@ describe("middleware", () => {
}
};
var DurableObjectExample = class {
static {
__name(this, \\"DurableObjectExample\\");
}
constructor(state, env) {
}
async fetch(request) {
return new Response(\\"Hello World\\");
}
};
__name(DurableObjectExample, \\"DurableObjectExample\\");


var MIDDLEWARE_TEST_INJECT = \\"__INJECT_FOR_TESTING_WRANGLER_MIDDLEWARE__\\";
Expand Down Expand Up @@ -939,6 +938,9 @@ describe("middleware", () => {
this.cron = cron;
this.#noRetry = noRetry;
}
static {
__name(this, \\"__Facade_ScheduledController__\\");
}
#noRetry;
noRetry() {
if (!(this instanceof ___Facade_ScheduledController__)) {
Expand All @@ -947,7 +949,6 @@ describe("middleware", () => {
this.#noRetry();
}
};
__name(__Facade_ScheduledController__, \\"__Facade_ScheduledController__\\");
function wrapExportedHandler(worker) {
if (__INTERNAL_WRANGLER_MIDDLEWARE__ === void 0 || __INTERNAL_WRANGLER_MIDDLEWARE__.length === 0) {
return worker;
Expand Down Expand Up @@ -988,15 +989,15 @@ describe("middleware", () => {
__facade_register__(middleware);
}
return class extends klass {
#fetchDispatcher = (request, env, ctx) => {
#fetchDispatcher = /* @__PURE__ */ __name((request, env, ctx) => {
this.env = env;
this.ctx = ctx;
if (super.fetch === void 0) {
throw new Error(\\"Entrypoint class does not define a fetch() function.\\");
}
return super.fetch(request);
};
#dispatcher = (type, init) => {
}, \\"#fetchDispatcher\\");
#dispatcher = /* @__PURE__ */ __name((type, init) => {
if (type === \\"scheduled\\" && super.scheduled !== void 0) {
const controller = new __Facade_ScheduledController__(
Date.now(),
Expand All @@ -1006,7 +1007,7 @@ describe("middleware", () => {
);
return super.scheduled(controller);
}
};
}, \\"#dispatcher\\");
fetch(request) {
return __facade_invoke__(
request,
Expand Down
Loading