Skip to content

Commit

Permalink
refactor: rename getEventContext to createEventContext
Browse files Browse the repository at this point in the history
  • Loading branch information
EresDev committed Nov 5, 2024
1 parent 3e83ba8 commit fcdd361
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/unit/get-best-card.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { onRequest as pagesFunction } from "../../functions/get-best-card";
import bestCard from "../fixtures/get-best-card/best-card-sandbox.json";
import card18597 from "../fixtures/get-best-card/card-18597.json";
import { httpMocks } from "../fixtures/http-mocks";
import { getEventContext as createEventContext, TESTS_BASE_URL } from "./shared-utils";
import { createEventContext, TESTS_BASE_URL } from "./shared-utils";

describe("Get best payment card", () => {
let server: SetupServerApi;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/get-order.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { afterAll, afterEach, beforeAll, describe, expect, it } from "vitest";
import { onRequest as pagesFunction } from "../../functions/get-order";
import order from "../fixtures/get-order/order.json";
import { httpMocks } from "../fixtures/http-mocks";
import { getEventContext as createEventContext, TESTS_BASE_URL } from "./shared-utils";
import { createEventContext, TESTS_BASE_URL } from "./shared-utils";

describe("Get payment card order", () => {
let server: SetupServerApi;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/get-redeem-code.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { afterAll, afterEach, beforeAll, describe, expect, it } from "vitest";
import { onRequest as pagesFunction } from "../../functions/get-redeem-code";
import card from "../fixtures/get-redeem-code/card.json";
import { httpMocks } from "../fixtures/http-mocks";
import { getEventContext as createEventContext, TESTS_BASE_URL } from "./shared-utils";
import { createEventContext, TESTS_BASE_URL } from "./shared-utils";

describe("Get payment card redeem code", () => {
let server: SetupServerApi;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/post-order.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import receiptTooLow from "../fixtures/post-order/receipt-too-low.json";
import receiptTxForMockedParse from "../fixtures/post-order/receipt-tx-for-mocked-parse.json";
import receiptUusd from "../fixtures/post-order/receipt-tx-uusd.json";
import receiptGeneric from "../fixtures/post-order/receipt.json";
import { getEventContext as createEventContext, TESTS_BASE_URL } from "./shared-utils";
import { createEventContext, TESTS_BASE_URL } from "./shared-utils";

describe("Post order for a payment card", () => {
let server: SetupServerApi;
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/shared-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Context } from "../../functions/utils/types";

export const TESTS_BASE_URL = "https://localhost";

export function getEventContext(request: Request, execContext: ExecutionContext, isSandbox: boolean = false) {
export function createEventContext(request: Request, execContext: ExecutionContext, isSandbox: boolean = false) {
const eventCtx: EventContext<typeof env, string, Record<string, unknown>> = {
request: request as Request<unknown, IncomingRequestCfProperties<unknown>>,
functionPath: "",
Expand Down

0 comments on commit fcdd361

Please sign in to comment.