-
Notifications
You must be signed in to change notification settings - Fork 345
Fix fetch implementation #1390
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
Merged
Merged
Fix fetch implementation #1390
Changes from 5 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5dc4668
Enforce maxRedirects and maxContentLength on the no-axios fetch path
Ryang-21 83daf74
Fix no-axios/minimal and browser builds to embed version via __PACKAG…
Ryang-21 20e44fe
Add vitest config and harness routing to test against the no-axios build
Ryang-21 c104a46
Add shared HttpClient contract spec covering axios and no-axios paths
Ryang-21 74d0507
update changelog
Ryang-21 a09e43e
Address Copilot review: redirect semantics, browser opaqueredirect, A…
Ryang-21 78dbaa7
Scope no-axios vitest coverage to lib/no-axios so report reflects cod…
Ryang-21 95ed1aa
fmt
Ryang-21 047d97d
Migrate Horizon fetchTimebounds tests from axios-mock-adapter to MSW …
Ryang-21 a1e3e36
Enable no-unused-vars lint rule with underscore ignore pattern
Ryang-21 01663c7
Add contract tests for interceptor order, header shape, defaults merg…
Ryang-21 c180bb4
Align fetch-client with axios: LIFO interceptors, normalized headers,…
Ryang-21 c211f70
Add tests for error headers, timeout fallback, adapter-override clamp
Ryang-21 c46b8d2
Normalize error headers, fix timeout fallback name, clamp adapter on …
Ryang-21 dcbbe28
revert axios parity changes that are not provided in the HttpRequestC…
Ryang-21 9c039d2
add aysnc tag so the return is a promise
Ryang-21 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
This file contains hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,41 @@ | ||
| import { defineConfig } from "vitest/config"; | ||
| import { resolve } from "path"; | ||
|
|
||
| export default defineConfig({ | ||
| test: { | ||
| globals: true, | ||
| environment: "node", | ||
| coverage: { | ||
| provider: "v8", | ||
| reporter: ["text", "html", "lcov"], | ||
| include: ["lib/**/*.js"], | ||
| exclude: [ | ||
| "test/**", | ||
| "dist/**", | ||
| "coverage/**", | ||
| "**/*.d.ts", | ||
| "lib/**/*.d.ts", | ||
| "lib/minimal", | ||
| "lib/no-axios", | ||
| "lib/no-eventsource", | ||
| "**/*/browser.js", | ||
| ], | ||
|
Ryang-21 marked this conversation as resolved.
|
||
| }, | ||
| testTimeout: 20000, | ||
| include: ["test/unit/**/*.test.ts"], | ||
| // horizon_axios_client is wired to axios-mock-adapter and cannot run on the fetch path. | ||
| exclude: ["**/browser.test.ts", "test/unit/horizon_axios_client.test.ts"], | ||
| }, | ||
| resolve: { | ||
| alias: { | ||
| "@": resolve(__dirname, "../src"), | ||
| }, | ||
| extensions: [".ts", ".tsx", ".js", ".jsx", ".json"], | ||
| }, | ||
|
|
||
| define: { | ||
| __USE_AXIOS__: false, | ||
| __USE_EVENTSOURCE__: true, | ||
| __PACKAGE_VERSION__: JSON.stringify(process.env.npm_package_version), | ||
| }, | ||
| }); | ||
This file contains hidden or 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
This file contains hidden or 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
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are multiple extra blank lines before the
### Deprecatedsection; consider removing them to keep the changelog formatting consistent.