Skip to content

Releases: zimicjs/zimic

v0.4.0-canary.6

17 May 22:45
Compare
Choose a tag to compare
v0.4.0-canary.6 Pre-release
Pre-release

Documentation

Full Changelog: diego-aquino/zimic@v0.4.0-canary.5...v0.4.0-canary.6

v0.4.0-canary.5

15 May 21:46
Compare
Choose a tag to compare
v0.4.0-canary.5 Pre-release
Pre-release

Features

Fixes

Full Changelog: diego-aquino/zimic@v0.4.0-canary.4...v0.4.0-canary.5

v0.4.0-canary.4

14 May 23:28
Compare
Choose a tag to compare
v0.4.0-canary.4 Pre-release
Pre-release

Fixes

Refactoring

Full Changelog: diego-aquino/zimic@v0.4.0-canary.3...v0.4.0-canary.4

v0.4.0-canary.3

11 May 14:44
Compare
Choose a tag to compare
v0.4.0-canary.3 Pre-release
Pre-release

Features

Refactoring

Note

Breaking changes between >= v0.1.0 and < v0.4.0-canary.3

  • Renamed the concept request tracker to request handler, which better indicates what they do.
    With this change, the following exports were changed:
    • HttpRequestTracker -> renamed to HttpRequestHandler
    • LocalHttpRequestTracker -> renamed to LocalHttpRequestHandler
    • RemoteHttpRequestTracker -> renamed to RemoteHttpRequestHandler
    • SyncedRemoteHttpRequestTracker -> renamed to SyncedRemoteHttpRequestHandler
    • PendingRemoteHttpRequestTracker -> renamed to PendingRemoteHttpRequestHandler
    • HttpRequestTrackerResponseDeclaration -> renamed to HttpRequestHandlerResponseDeclaration
    • HttpRequestTrackerResponseDeclarationFactory -> renamed to HttpRequestHandlerResponseDeclarationFactory
  • 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

11 May 13:08
Compare
Choose a tag to compare
v0.4.0-canary.2 Pre-release
Pre-release

What's Changed

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 a type and a baseURL 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 -> removed
    • HttpInterceptorWorker -> removed
    • LocalHttpInterceptorWorker -> removed
    • RemoteHttpInterceptorWorker -> removed
    • HttpInterceptorWorkerOptions -> removed
    • LocalHttpInterceptorWorkerOptions -> removed
    • RemoteHttpInterceptorWorkerOptions -> removed
    • HttpInterceptorWorkerType -> changed to HttpInterceptorType
    • HttpInterceptorWorkerPlatform -> changed to HttpInterceptorPlatform
    • UnknownHttpInterceptorWorkerPlatform -> changed to UnknownHttpInterceptorPlatform
    • NotStartedHttpInterceptorWorkerError -> changed to NotStartedHttpInterceptorError
    • 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

04 May 22:04
Compare
Choose a tag to compare
v0.4.0-canary.1 Pre-release
Pre-release

Features

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' or type: 'remote' when creating workers with createHttpInterceptorWorker. By using the remote type, you will be able to use a full mock server instead of a local interception algorithm. Changing between local and remote requires no mock changes except adding await keywords when applying your mocks and getting the list of intercepted requests.
  • GET, HEAD, and OPTIONS 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, the HEAD 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

12 Apr 19:03
Compare
Choose a tag to compare
v0.4.0-canary.0 Pre-release
Pre-release

Features

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

31 Mar 01:25
1ca55b5
Compare
Choose a tag to compare

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 to zimic.

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

v0.3.0-canary.8

29 Mar 19:05
Compare
Choose a tag to compare
v0.3.0-canary.8 Pre-release
Pre-release

v0.3.0-canary.7

29 Mar 18:45
Compare
Choose a tag to compare
v0.3.0-canary.7 Pre-release
Pre-release