Skip to content

Commit

Permalink
feat: check for name error on species test e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
ViniciusCestarii committed Dec 4, 2024
1 parent 83dd66e commit af5e819
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/modules/pet/species/controllers/create.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,7 @@ describe("Create specie e2e", () => {

const body = await response.json();

expect(body).toMatchObject({
name: "Error",
message: "Specie already exists",
});
expect(body.name).toBe("SpecieAlreadyExistsError");

Check failure on line 52 in src/modules/pet/species/controllers/create.test.ts

View workflow job for this annotation

GitHub Actions / E2E Tests

error: expect(received).toBe(expected)

Expected: "SpecieAlreadyExistsError" Received: "SpecieAlredyExistsError" at /home/runner/work/modular-pets/modular-pets/src/modules/pet/species/controllers/create.test.ts:52:23

expect(response.status).toBe(409);
});
Expand Down
1 change: 1 addition & 0 deletions src/modules/pet/species/errors/specie-alredy-exists.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
export class SpecieAlredyExistsError extends Error {
constructor() {
super("Specie already exists");
this.name = "SpecieAlredyExistsError";
}
}

0 comments on commit af5e819

Please sign in to comment.