Releases: zimicjs/zimic
v0.4.0-canary.6
Documentation
- docs: playwright and next.js examples (#76) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/146
Full Changelog: diego-aquino/zimic@v0.4.0-canary.5...v0.4.0-canary.6
v0.4.0-canary.5
Features
- feat: invalid URL error (#141) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/143
Fixes
- fix: force client to disconnect on server stop (#142) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/144
Full Changelog: diego-aquino/zimic@v0.4.0-canary.4...v0.4.0-canary.5
v0.4.0-canary.4
Fixes
- fix: multiple dynamic parameters (#137) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/138
Refactoring
- refactor: split fetch and url utilities by @diego-aquino in https://github.com/diego-aquino/zimic/pull/139
Full Changelog: diego-aquino/zimic@v0.4.0-canary.3...v0.4.0-canary.4
v0.4.0-canary.3
Features
- feat: no body request validation (#134) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/136
Refactoring
- refactor(#zimic)!: rename request tracker to request handler (#132) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/135
Note
Breaking changes between >= v0.1.0 and < v0.4.0-canary.3
- Renamed the concept
request tracker
torequest handler
, which better indicates what they do.
With this change, the following exports were changed:HttpRequestTracker
-> renamed toHttpRequestHandler
LocalHttpRequestTracker
-> renamed toLocalHttpRequestHandler
RemoteHttpRequestTracker
-> renamed toRemoteHttpRequestHandler
SyncedRemoteHttpRequestTracker
-> renamed toSyncedRemoteHttpRequestHandler
PendingRemoteHttpRequestTracker
-> renamed toPendingRemoteHttpRequestHandler
HttpRequestTrackerResponseDeclaration
-> renamed toHttpRequestHandlerResponseDeclaration
HttpRequestTrackerResponseDeclarationFactory
-> renamed toHttpRequestHandlerResponseDeclarationFactory
- Added an additional validation to interceptor schemas, ensuring that 204 responses do not contain a body.
- HEAD requests or 204 responses now are guaranteed to have an empty body, even if one is passed in the code.
Full Changelog: diego-aquino/zimic@v0.4.0-canary.2...v0.4.0-canary.3
v0.4.0-canary.2
What's Changed
- feat(#zimic)!: internal worker management (#127) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/133
const authInterceptor = createHttpInterceptor<AuthServiceSchema>({
type: 'local',
baseURL: 'http://localhost:3000'
});
const notificationInterceptor = createHttpInterceptor<NotificationServiceSchema>({
type: 'remote',
baseURL: `http://localhost:4000/notifications-${crypto.randomUUID()}`
});
Note
Breaking changes between >= v0.1.0 and < v0.4.0-canary.2
- Simplified the interceptor factory
createHttpInterceptor
to receive only atype
and abaseURL
as parameters. Creating, sharing, starting and stopping workers are now performed internally. Therefore, workers no longer have to be created and passed directly when creating an interceptor, simplifying the API. 🎉
With this change, the following exports were changed:createHttpInterceptorWorker
-> removedHttpInterceptorWorker
-> removedLocalHttpInterceptorWorker
-> removedRemoteHttpInterceptorWorker
-> removedHttpInterceptorWorkerOptions
-> removedLocalHttpInterceptorWorkerOptions
-> removedRemoteHttpInterceptorWorkerOptions
-> removedHttpInterceptorWorkerType
-> changed toHttpInterceptorType
HttpInterceptorWorkerPlatform
-> changed toHttpInterceptorPlatform
UnknownHttpInterceptorWorkerPlatform
-> changed toUnknownHttpInterceptorPlatform
NotStartedHttpInterceptorWorkerError
-> changed toNotStartedHttpInterceptorError
OtherHttpInterceptorWorkerRunningError
-> removed
- HTTP interceptors are now automatically cleared when they are stopped. This is to prevent memory leaks. Previously, it was necessary to manually clear each interceptors before stopping them.
- Removed the server parameters
--life-cycle-timeout
and--rpc-timeout
. They were not used as of now and were proving to be unnecessary to the current implementation. If the need arises, they can be added back in the future.
Full Changelog: diego-aquino/zimic@v0.4.0-canary.1...v0.4.0-canary.2
v0.4.0-canary.1
Features
- feat: inferred dynamic paths (#123) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/125
- feat!: http mock server (#83) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/128
- build: support to node 22 (#126) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/129
Note
Breaking changes between >= v0.1.0 and < v0.4.0-canary.1
- Interceptor worker platforms are now inferred, so they are no longer needed when using
createHttpInterceptorWorker
. - It is now necessary to specify
type: 'local'
ortype: 'remote'
when creating workers withcreateHttpInterceptorWorker
. By using the remote type, you will be able to use a full mock server instead of a local interception algorithm. Changing betweenlocal
andremote
requires no mock changes except addingawait
keywords when applying your mocks and getting the list of intercepted requests. GET
,HEAD
, andOPTIONS
methods are now validated to have no declared request bodies in service schemas, as they do not support bodies. On top of no request bodies, theHEAD
method also does not support a response body and is checked as so.
Full Changelog: diego-aquino/zimic@v0.3.0...v0.4.0-canary.1
v0.4.0-canary.0
Features
- feat: inferred dynamic paths (#123) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/125
Note
Breaking change between >= v0.1.0 and < v0.4.0-canary.0
Literal paths are now automatically inferred from dynamic paths using interpolation.
Previously, Zimic required an explicit declaration of the literal path:
const deleteTracker = authInterceptor.delete<'/users/:id'>(`/users/${user.id}`).respond({
status: 204,
});
Now, the literal path is automatically inferred, while still preserving type safety!
const deleteTracker = authInterceptor.delete(`/users/${user.id}`).respond({
status: 204,
});
Full Changelog: diego-aquino/zimic@v0.3.0...v0.4.0-canary.0
v0.3.0
v0.3.0 is here! 🎉
Features
- Added support to tracker restrictions, supporting headers, search params, and bodies. With restrictions, you can now target mock responses to specific requests.
- It is now possible to clear tracker responses, restrictions and intercepted requests using
clear()
.bypass()
now only clears the declared response, keeping any restrictions and intercepted requests. - Added strict JSON validation to interceptor schemas.
Refactoring
- Moved generic HTTP type exports from
zimic/interceptor
tozimic
.
Check out the Migration guide to learn more about using the strict JSON validation and the new HTTP type exports!
Credits
Huge thanks to @diego-aquino for helping!
Full Changelog: v0.2.1...v0.3.0
- feat: request match by search params (#13) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/99
- feat: http request tracker clear (#100) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/101
- feat: request match by headers (#16) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/102
- chore: sync
canary
withv0.2.x
by @diego-aquino in https://github.com/diego-aquino/zimic/pull/107 - feat: request match by body (#12) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/108
- feat: strict JSON validation (#106) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/109
- refactor(#zimic)!: simplify type exports (#113) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/114
- build: dependency upgrades by @diego-aquino in https://github.com/diego-aquino/zimic/pull/115
- feat: support to typescript 5.4 by @diego-aquino in https://github.com/diego-aquino/zimic/pull/116
- docs: v0.3.0 (#24) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/117
- chore: typescript CI matrix (#68) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/118
- chore: check typescript 5.0 on CI (#68) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/119
- chore(release): v0.3.0 by @diego-aquino in https://github.com/diego-aquino/zimic/pull/120
v0.3.0-canary.8
Chore
- chore: check typescript 5.0 on CI (#68) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/119
Full Changelog: diego-aquino/zimic@v0.3.0-canary.7...v0.3.0-canary.8
v0.3.0-canary.7
Chore
- chore: typescript CI matrix (#68) by @diego-aquino in https://github.com/diego-aquino/zimic/pull/118
Full Changelog: diego-aquino/zimic@v0.3.0-canary.6...v0.3.0-canary.7