You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do you want to request a feature or report a bug?
I want to request a feature
What is the current behavior?
test('Should return jwt after successfully registration',async()=>{awaitremoveTestUser();constresponse=awaitrequest(app).post(signupAPI).send(testUser);expect(response.statusCode).toBe(200);expect(response.body).not.toHaveProperty('error');expect(response.body).toHaveProperty('user');expect(response.body.user.name).toBeDefined();expect(response.body.user.email).toBeDefined();expect(response.body.user.token).toBeDefined();awaitremoveTestUser();});
I use supertest + jest to test my express.js application, all use the latest version.
The test runs fine. The problem is, if there is anything wrong, the output would be:
● [API Test] /api/auth/register › Should return jwt after successfully registration
expect(received).toBeDefined()
Expected value to be defined, instead received
undefined
at _callee8$ (tests/backend/integration/signup.test.js:98:57)
at tryCatch (node_modules/regenerator-runtime/runtime.js:65:40)
Some situation like this, If the value is undefined,
And I happen to have multiple same assert,
There is no way to see the reason in the bash,
I need to track back to the file to see which line threw the error.
Yes, I should track back, but wouldn't it better to show a result like below:
What is the expected behavior?
● [API Test] /api/auth/register › Should return jwt after successfully registration
expect(response.body.user.name).toBeDefined()
Expected response.body.user.name to be defined, instead received
undefined
at _callee8$ (tests/backend/integration/signup.test.js:98:57)
at tryCatch (node_modules/regenerator-runtime/runtime.js:65:40)
Thanks :) Love jest.
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
Do you want to request a feature or report a bug?
I want to request a feature
What is the current behavior?
I use supertest + jest to test my express.js application, all use the latest version.
The test runs fine. The problem is, if there is anything wrong, the output would be:
Some situation like this, If the value is undefined,
And I happen to have multiple same assert,
There is no way to see the reason in the bash,
I need to track back to the file to see which line threw the error.
Yes, I should track back, but wouldn't it better to show a result like below:
What is the expected behavior?
Thanks :) Love jest.
Please provide your exact Jest configuration and mention your Jest, node, yarn/npm version and operating system.
The text was updated successfully, but these errors were encountered: