-
Notifications
You must be signed in to change notification settings - Fork 585
Migrate to ofetch #904
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
Open
wa0x6e
wants to merge
33
commits into
master
Choose a base branch
from
migrate-ofetch
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+915
−171
Open
Migrate to ofetch #904
Changes from 6 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
1c2f3d9
chore: migrate fetch lib from cross-fetch to ofetch
wa0x6e 0304356
feat: add timeout to fetch requests
wa0x6e 60faabe
chore: fix tests
wa0x6e bf0c869
Merge branch 'master' into migrate-ofetch
wa0x6e 170b932
chore: add more tests
wa0x6e b212168
chore: add more test
wa0x6e a910087
Merge branch 'master' into migrate-ofetch
wa0x6e 3dc29cb
chore: remove uneeded JSON.stringify
wa0x6e 6bc962f
Merge branch 'migrate-ofetch' of https://github.com/snapshot-labs/sna…
wa0x6e 77a6c2f
chore: split long line
wa0x6e cfd5246
fix: handle errors when parsing json response
wa0x6e fc18bab
fix: migrate fetch request to ofetch API
wa0x6e 836dddf
chore: bump version
wa0x6e bc64032
chore: add more todo test
wa0x6e 137ffa1
chore: rename test function
wa0x6e 2cb0b93
chore: use .js extension for test files
wa0x6e 925f2b8
chore: improve/add more tests
wa0x6e ba1889c
chore: add more tests
wa0x6e 83981d4
Merge branch 'master' into migrate-ofetch
wa0x6e 1610b3d
chore: fix tests
wa0x6e 305935b
chore: fix tests
wa0x6e bfad8f7
fix: add more tests
wa0x6e 3bb41c9
chore: fix tests
wa0x6e 3d1dc2a
chore: remove redundant function calls
wa0x6e dbc44e0
chore: fix test
wa0x6e 261a6e4
chore: add retry to flaky tests
wa0x6e 58fc436
chore: improve tests
wa0x6e 520b95e
Merge branch 'master' into migrate-ofetch
wa0x6e 96d7df1
Merge branch 'master' into migrate-ofetch
wa0x6e 93f8069
chore: fix tests for node 18
wa0x6e bec2e3a
Merge branch 'master' into migrate-ofetch
ChaituVR b2cc4b2
Merge branch 'master' into migrate-ofetch
wa0x6e cfb0e3e
chore: bump feat version instead of major
wa0x6e 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
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,31 @@ | ||
import { describe, test, expect } from 'vitest'; | ||
import Client from '../../../src/sign/'; | ||
|
||
describe('Client', () => { | ||
describe('send()', () => { | ||
describe('on error', () => { | ||
wa0x6e marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const payload = { address: '', sig: '', data: '' }; | ||
|
||
test('should return the error from sequencer as a Promise rejection', async () => { | ||
expect.assertions(1); | ||
const client = new Client(); | ||
await expect(client.send(payload)).to.rejects.toEqual({ | ||
error: 'client_error', | ||
error_description: 'wrong envelope format' | ||
}); | ||
}); | ||
|
||
test.each([ | ||
['ENOTFOUND', 'https://unknown.snapshot.org'], | ||
['404 Not Found', 'https://httpstat.us/404'] | ||
])( | ||
'should return the network error (%s) as Promise rejection', | ||
async (code, url) => { | ||
expect.assertions(1); | ||
const client = new Client(url); | ||
await expect(() => client.send(payload)).rejects.toThrowError(code); | ||
} | ||
); | ||
}); | ||
}); | ||
}); |
wa0x6e marked this conversation as resolved.
Show resolved
Hide resolved
|
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
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.
Uh oh!
There was an error while loading. Please reload this page.