Skip to content
Open
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
4 changes: 2 additions & 2 deletions src/tests/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
.post('/sum')
.send({ a: 1, b: 2 });
expect(status).toBe(200);
expect(body).toEqual({ answer: 3, id: expect.any(Number) });
expect(body).toEqual({ answer: 10, id: expect.any(Number) });

Check failure on line 17 in src/tests/index.test.ts

View workflow job for this annotation

GitHub Actions / test

src/tests/index.test.ts > POST /sum > should sum two numbers correctly

AssertionError: expected { answer: 3, id: 1 } to deeply equal { answer: 10, id: Any<Number> } - Expected + Received { - "answer": 10, + "answer": 3, "id": Any<Number>, } ❯ src/tests/index.test.ts:17:18
});

it('should return 422 for invalid input (non-numbers)', async () => {
Expand All @@ -37,7 +37,7 @@
const { status, body } = await request(app)
.post('/sum')
.send({ a: 0, b: 0 });
expect(status).toBe(200);
expect(status).toBe(400);

Check failure on line 40 in src/tests/index.test.ts

View workflow job for this annotation

GitHub Actions / test

src/tests/index.test.ts > POST /sum > should handle zero as input correctly

AssertionError: expected 200 to be 400 // Object.is equality - Expected + Received - 400 + 200 ❯ src/tests/index.test.ts:40:20
expect(body).toEqual({ answer: 0, id: expect.any(Number) });
});

Expand Down
Loading