Tests are written with numerous gross mistakes
KostyaTretyak opened this issue · comments
Is there an existing issue for this?
- I have searched the existing issues
Current behavior
Tests are written with numerous gross mistakes. For example:
- In this code and all async tests with
.resolves.
/.rejects.
syntax:
Lines 53 to 57 in c2c8a80
You need to put await
before expect
. See docs for Testing Asynchronous Code.
-
After that, the tests start to crash with a timeout. This is because the wrong configuration of jest spy. As far as I understand, jest spy is not used at all.
-
If you remove jest spy, the tests begin to fail due to incorrect expectations. For example
sign()
returns token, but here expected secret:
Lines 79 to 81 in c2c8a80
- And so on...
Minimum reproduction code
No response
Steps to reproduce
No response
Expected behavior
Tests must be written accurately and correctly.
Package version
8.0.0
NestJS version
No response
Node.js version
No response
In which operating systems have you tested?
- macOS
- Windows
- Linux
Other
No response
Tests were added via external contribution as part of this commit 9bae007. Feel free to create a follow-up PR to improve them.