-
-
Notifications
You must be signed in to change notification settings - Fork 14
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mocked
type is missing in @suites/unit
#426
Comments
Hi, Thank you for submitting this issue. I'll take a look and update here soon! |
Plus one on this @omermorad 🙏 |
I will look into this issue in October and try and solve it. |
@roniavi @michaelcai - While @qballer works to resolve this problem, please try the following workaround: Try importing import type { Mocked } from '@suites/doubles.jest'; This is a workaround; in order to maintain consistency and library agnostic behavior (mocking library), the Tell me whether it was successful please :) |
https://github.com/qballer/suites_issue_426 |
Mocked
type is missing in '@suites/unit'Mocked
type is missing in @suites/unit
I reconstructed the bug in the exact way described in the issue. https://github.com/qballer/suites_issue_426 It works out of the box as expected, but after installing an additional package (e.g Is missing: The same triple slash is missing in Manually adding that to the d.ts file fixes the problem. I've also noticed that the following is missing from Digging through the code, these are all added via post-install scripts of Which yarn version is being used? |
### Description This pull request refactors the questions-service to adopt the **hexagonal architecture**, separating business logic from database concerns and improving testability. ![Question Hexagonal Architecture drawio (2)](https://github.com/user-attachments/assets/3949985f-6859-48b0-b1dc-7179dccb4442) ### Changes made - Created the `questions.repository.ts` abstract class - existing `questions.service.ts` now depends on this new abstract class to handle database operations - Moved supabase-related methods to its own class: `questions.supabase.ts` - implements `questions.repository.ts` ### New directory structure ```text src/ ├── adapters/ │ └── controllers/ │ │ └── questions.controller.ts │ └── db/ │ └── questions.supabase.ts ├── domains/ │ └── ports/ │ ├── questions.repository.ts │ └── questions.service.ts ├── questions.module.ts └── main.ts ``` ### Future enhancements **Testing** - `nestjs` recommends using [automock](https://docs.nestjs.com/recipes/automock#introduction) library (now called suites) for testing, but there are issues with the library at the moment. - I'll incorporate unit tests into our microservices once the this [issue](suites-dev/suites#426) has been resolved (I've tried using their suggested workaround, it doesn't work)
@michaelcai @jeffrey-jian @roniavi (also related to #439 - @mbrunoviegas) Due to a known issue with Yarn v1.x's Please, let me know if it worked for you. |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Is there an existing issue for this?
Current behavior
Description:
The @suites/unit package does not export the Mocked type as expected. When trying to import the Mocked type from @suites/unit using:
I receive the following error message:
Module '"@suites/unit"' has no exported member named 'Mocked'.
Minimum reproduction code
no
Steps to reproduce
No response
Expected behavior
Please include the Mocked type in the package's exports, or provide documentation for an alternative way to mock objects if the Mocked type has been deprecated or replaced.
Suites version
3.0.0
Node.js version
20.16.0
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: