Skip to content

Commit

Permalink
renamed harness func
Browse files Browse the repository at this point in the history
  • Loading branch information
electricmonk committed Oct 2, 2023
1 parent bbb5515 commit 9b3b669
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/client/src/adapters/harness.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type AppContext = {
orderRepo?: InMemoryOrderRepository
};

export async function makeApp({
export async function runServerAndRenderApp({
productRepo = new InMemoryProductRepository(),
orderRepo = new InMemoryOrderRepository()
}: AppContext) {
Expand Down
4 changes: 2 additions & 2 deletions packages/client/test/purchase.flow.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {aProduct} from "@ts-react-tdd/server/src/builders";
import {makeApp} from "../src/adapters/harness";
import {runServerAndRenderApp} from "../src/adapters/harness";
import {InMemoryProductRepository} from "@ts-react-tdd/server/src/adapters/fakes";

test("a user can purchase a product, see the confirmation page and see their order summary, after which the cart is reset", async () => {

const moogOne = aProduct({title: "Moog One"});
using harness = await makeApp({
using harness = await runServerAndRenderApp({
productRepo: new InMemoryProductRepository([moogOne]),
});
const {driver, orderRepo} = harness;
Expand Down
4 changes: 2 additions & 2 deletions packages/client/test/search.flow.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {aProduct} from "@ts-react-tdd/server/src/builders";
import {makeApp} from "../src/adapters/harness";
import {runServerAndRenderApp} from "../src/adapters/harness";
import userEvent from "@testing-library/user-event";
import {InMemoryProductRepository} from "@ts-react-tdd/server/src/adapters/fakes";

Expand All @@ -8,7 +8,7 @@ test("Product search is case-insensitive", async () => {
const moogOne = aProduct({title: "Moog One"});
const minimoog = aProduct({title: "Minimoog"});
const ob8x = aProduct({title: "OB 8x"});
using harness = await makeApp({
using harness = await runServerAndRenderApp({
productRepo: new InMemoryProductRepository([moogOne, minimoog, ob8x]),
});
const {driver} = harness;
Expand Down

0 comments on commit 9b3b669

Please sign in to comment.