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

Fix integration tests sending events #522

Merged
merged 2 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
3 changes: 1 addition & 2 deletions packages/inngest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,7 @@
"shx": "^0.3.4",
"ts-jest": "^29.1.0",
"tsx": "^3.12.7",
"typescript": "~5.4.0",
"ulid": "^2.3.0"
"typescript": "~5.4.0"
},
"volta": {
"node": "18.12.1",
Expand Down
7 changes: 3 additions & 4 deletions packages/inngest/src/test/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import fetch from "cross-fetch";
import { type Request, type Response } from "express";
import nock from "nock";
import httpMocks from "node-mocks-http";
import { ulid } from "ulid";
import { z } from "zod";

interface HandlerStandardReturn {
Expand Down Expand Up @@ -914,20 +913,20 @@ export const sendEvent = async (
data?: Record<string, unknown>,
user?: Record<string, unknown>
): Promise<string> => {
const id = ulid();

const res = await fetch("http://localhost:8288/e/key", {
method: "POST",
headers: {
"Content-Type": "application/json",
},
body: JSON.stringify({ id, name, data: data || {}, user, ts: Date.now() }),
body: JSON.stringify({ name, data: data || {}, user, ts: Date.now() }),
});

if (!res.ok) {
throw new Error(await res.text());
}

const id = (await res.json()).ids[0];

return id;
};

Expand Down
54 changes: 6 additions & 48 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading