-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Labels
good first issueGood for newcomersGood for newcomerstype: bugSomething isn't workingSomething isn't working
Milestone
Description
What happened?
When we generate a controller test for the user we use in the 404 test the number instead of the HttpStatus.NOT_FOUND enum
What you expected to happen
We use const or enum variables
The old:
test("GET /customers/:id non existing", async () => {
await request(app.getHttpServer())
.get(`${"/customers"}/${nonExistingId}`)
.expect(404)
.expect({
statusCode: 404,
message: `No resource was found for {"${"id"}":"${nonExistingId}"}`,
error: "Not Found",
});
});
The Wanted:
test("GET /customers/:id non existing", async () => {
await request(app.getHttpServer())
.get(`${"/customers"}/${nonExistingId}`)
.expect(HttpStatus.NOT_FOUND)
.expect({
statusCode: HttpStatus.NOT_FOUND,
message: `No resource was found for {"${"id"}":"${nonExistingId}"}`,
error: "Not Found",
});
});
How to reproduce
generate an app -> go to any controller test -> see the GET id not exist test
Amplication version
0.12.0
Environment
No response
Are you willing to submit PR?
Yes I am willing to submit a PR!
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomerstype: bugSomething isn't workingSomething isn't working