-
Notifications
You must be signed in to change notification settings - Fork 0
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
chore(release): v0.3.0 #120
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- chore(ci): disable fail-fast
- build(#zimic): disable build minification
- build(root): upgrade turbo to latest version
- fix(#zimic): add missing error names - feat(#zimic): improve mismatched platform error handling - test(#zimic): improve error assertions
### Refactor - [#zimic] Improve internal class names - `InternalHttpInterceptor` -> `HttpInterceptor` - `InternalHttpInterceptorWorker` -> `HttpInterceptorWorker` - `InternalHttpRequestTracker` -> `HttpRequestTracker` ### Chore - [zimic-test-client, #release, #zimic] Removed unused file references
### Fixes - [examples-vitest-browser] Ignored postinstall errors, preventing build problems on GitHub Actions.
### Fixes - [ci] Escaped newlines in turbo commands of post-released checks.
### Fixes - [examples] Enabled vm modules in Jest examples, required because Zimic uses dynamic imports. - [ci] Restricted remote Zimic versions to zimic-test-client and examples.
### Refactoring - [#zimic] Renamed request tracker tests to match their class names. ### Documentation - [#zimic] Added comments to expected TypeScript errors for clarity.
### Build - [root] Upgrade `vite` and `@types/node` to their latest versions. - [root] Remove unnecessary `@types/node` from packages that do not need it. Also solves https://github.com/diego-aquino/zimic/security/dependabot/1.
### Refactoring - [#zimic] Move generic HTTP implementations to a dedicated directory, including search params. - [#zimic] Remove an unnecessary internal type from exports. - [#zimic] Simplified search param schema exports.
- perf(root): improve local and ci test concurrency
### Features - [#zimic] Added support to restricting request trackers by exact or partial search params. - [#zimic] Included `HttpHeadersInit` and `HttpSearchParamsInit` to the type exports. ```ts const user = users[0]; const listTracker = authInterceptor .get('/users') .with({ searchParams: { name: user.name }, }) .respond({ status: 200, body: [user], }); const response = await listUsers({ name: user.name }); expect(response.status).toBe(200); const returnedUsers = (await response.json()) as User[]; expect(returnedUsers).toEqual([user]); ``` Closes #13.
### Features - [#zimic] Created a new method `clear()` to clear all declared responses, restrictions and intercepted requests and responses from request trackers. - BREAKING CHANGE: [`tracker.bypass()`](https://github.com/diego-aquino/zimic#trackerbypass) no longer clears the intercepted requests and responses from the tracker. Closes #100.
### Features - [#zimic] Added support to restrict request trackers by HTTP headers. - [#zimic] Added support to compare equality and containment of HTTP headers. ### Fixes - [#zimic] Fixed the semantics of search param comparisons. Now `param1.contains(param2)` returns `true` only if all key-value pairs of `param2` are present in `param1`, regardless of `param1` having more key-pairs than `param2`. The previous behavior was that `param1.contains(param2)` would return `true` only if all key-value pairs of `param1` were present in `param2`, which is not correct because the semantics are reversed. ```ts const creationTracker = authInterceptor .post('/users') .with({ headers: { 'content-type': 'application/json' }, }) .respond((request) => { const user: User = { id: crypto.randomUUID(), name: request.body.name, email: request.body.email, }; return { status: 201, body: user, }; }); const response = await createUser(creationPayload); expect(response.status).toBe(201); ``` Closes #86.
### Features - [#zimic] Added support to restrict request trackers by body. ```ts const creationTracker = authInterceptor .post('/users') .with({ body: creationPayload, }) .respond((request) => { const user: User = { id: crypto.randomUUID(), name: request.body.name, email: request.body.email, }; return { status: 201, body: user, }; }); const response = await createUser(creationPayload); expect(response.status).toBe(201); ``` ### Refactoring - [#zimic] Simplified request and response body schemas. - Unified `HttpInterceptorSchema.RequestBody` and `HttpInterceptorSchema.ResponseBody` into `HttpInterceptorSchema.Body`, as the previous `RequestBody` and `ResponseBody` had the same semantics. - [#zimic] Improved HTTP interceptor test scenarios, following real-world cases more closely for each method. Closes #12.
### Features - [#zimic] Added the utility types `JSONCompatible` and `JSONSerialized`. - [#zimic] Added strict JSON validation to interceptor schemas. Since this is a breaking change, see the [Migration guide](#106 (comment)) to enable the strict validation! Closes #106.
### Refactoring - [#zimic] Simplified and improved the type exports. Check out the [Migration guide](#113 (comment)) for more information. ### Fixes - [#zimic] Extended `JSONSerialized` to correctly exclude functions with arguments from the result type. Previously, only functions that had no arguments were excluded. Closes #113.
### Build - Upgraded most of dependencies and dev dependencies. It was not possible to upgrade to the latest `vitest` version due to concurrency problems happening after `1.3.0`, so I updated it to `1.2.2`.
### Features - [#zimic] Added support to TypeScript 5.4.
### Documentation - [#zimic] Improved the examples using headers and search params. - [#zimic] Added a link to the examples section to the headline. - [#zimic] Documented the new APIs `tracker.with(restriction)` and `tracker.clear()`. - [#zimic] Improved notes using [Markdown Alerts](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#alerts). Closes #24.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Releases
Check out the Migration guide to learn more about migrating from
v0.2
tov0.3
.