Skip to content

Commit

Permalink
fixup! fix: remove invalid ctx import from hello-world experimental…
Browse files Browse the repository at this point in the history
… templates
  • Loading branch information
petebacondarwin committed Sep 26, 2024
1 parent 9467d7a commit 7f03b42
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import worker from '../src';
describe('Hello World user worker', () => {
describe('request for /message', () => {
it('/ responds with "Hello, World!" (unit style)', async () => {
const request = new Request('http://example.com/message');
const request = new Request<unknown, IncomingRequestCfProperties>('http://example.com/message');
// Create an empty context to pass to `worker.fetch()`.
const ctx = createExecutionContext();
const response = await worker.fetch(request, env, ctx);
Expand All @@ -16,14 +16,14 @@ describe('Hello World user worker', () => {

it('responds with "Hello, World!" (integration style)', async () => {
const request = new Request('http://example.com/message');
const response = await SELF.fetch(request, env, ctx);
const response = await SELF.fetch(request, env);
expect(await response.text()).toMatchInlineSnapshot(`"Hello, World!"`);
});
});

describe('request for /random', () => {
it('/ responds with a random UUID (unit style)', async () => {
const request = new Request('http://example.com/random');
const request = new Request<unknown, IncomingRequestCfProperties>('http://example.com/random');
// Create an empty context to pass to `worker.fetch()`.
const ctx = createExecutionContext();
const response = await worker.fetch(request, env, ctx);
Expand All @@ -34,7 +34,7 @@ describe('Hello World user worker', () => {

it('responds with a random UUID (integration style)', async () => {
const request = new Request('http://example.com/random');
const response = await SELF.fetch(request, env, ctx);
const response = await SELF.fetch(request);
expect(await response.text()).toMatch(/[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}/);
});
});
Expand Down

0 comments on commit 7f03b42

Please sign in to comment.