Closed ksaaskil closed 4 years ago
Merging #355 into dev will decrease coverage by
0.64%
. The diff coverage is77.64%
.
@@ Coverage Diff @@
## dev #355 +/- ##
==========================================
- Coverage 81.06% 80.42% -0.65%
==========================================
Files 53 54 +1
Lines 2361 2416 +55
Branches 577 586 +9
==========================================
+ Hits 1914 1943 +29
- Misses 447 473 +26
Impacted Files | Coverage Δ | |
---|---|---|
packages/unmock-core/src/nock.ts | 74.73% <100%> (ø) |
:arrow_up: |
packages/unmock-core/src/backend/index.ts | 89.09% <100%> (-0.2%) |
:arrow_down: |
packages/unmock-core/src/index.ts | 79.24% <66.66%> (-5.76%) |
:arrow_down: |
packages/unmock-core/src/service/serviceStore.ts | 82.53% <73.17%> (-17.47%) |
:arrow_down: |
packages/unmock-core/src/faker/index.ts | 80.76% <80.76%> (ø) |
|
...kages/unmock-node/src/loggers/filesystem-logger.ts | 66.66% <0%> (-29.63%) |
:arrow_down: |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 0298b97...c7215de. Read the comment docs.
Yeah we should add something about it in the documentation! It's currently however more for internal development and it'll likely change quite a bit as new needs emerge, so I wouldn't maybe do that yet.
UnmockFaker
class responsible for faking responses to serialized requests, lifting that responsibility fromBackend
class.unmock.nock
so that the same API can be used also fromUnmockFaker
to add servicesServiceStore
:update
,removeAll
,resetServices
The purpose of all this is that one can separate the mock generation logic from the interceptor logic: one can create mock responses via
UnmockFaker
without starting the interceptor and add new services and modify their states. And it's nice that one can create multiple independent fakers, as the big bad global interceptor is separate from the faking logic.