https://github.com/rickdgeerling/nest-dynamic-module-spies
https://github.com/rickdgeerling/nest-dynamic-module-spies
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rickdgeerling/nest-dynamic-module-spies
- Owner: rickdgeerling
- Created: 2022-11-04T10:20:33.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-11-04T10:20:48.000Z (about 3 years ago)
- Last Synced: 2025-04-10T19:39:02.805Z (8 months ago)
- Language: TypeScript
- Size: 64.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Reproduction repo
This repository reproduces an issue we encountered mocking a service inside a dynamic module. Probably not a bug though, just an edge-case 🤔
To run this reproduction:
```sh
pnpm install
pnpm run test:e2e
```
You can play around with the `count` parameter of the dynamic module. If all modules have the same count, every test passes. If they differ one or more tests start failing.
We're assuming that there's multiple instances of the `SomeService` in the dependency tree, one for each unique config. Running `app.get(SomeService)` simply gets you _one_ instance, but it seems unpredictable which one.