Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thescientist13/fetch-tests
A repo for testing fetch and http implementations
https://github.com/thescientist13/fetch-tests
Last synced: 6 days ago
JSON representation
A repo for testing fetch and http implementations
- Host: GitHub
- URL: https://github.com/thescientist13/fetch-tests
- Owner: thescientist13
- Created: 2022-11-11T17:48:03.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2022-11-11T20:16:02.000Z (about 2 years ago)
- Last Synced: 2024-11-09T06:40:55.548Z (2 months ago)
- Language: JavaScript
- Size: 11.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# fetch-tests
A repo for testing fetch and http implementations. For some reason, it seems _query strings_ aren't behaving as expected with native **fetch** / **node-fetch** as with raw HTTP.
Seeing it in both these projects
- https://github.com/AnalogStudiosRI/www.analogstudios.net/issues/81
- https://github.com/AnalogStudiosRI/www.tuesdaystunes.tv/blob/main/src/pages/index.js#L11## Setup
1. Clone this repo
1. Run `nvm` (or make sure you are using Node >= `18.11.x`)
1. Run `npm ci`To generate the the results, run
```sh
$ sh test.sh
```## Results
```sh
owenbuckley@Owens-MBP-2 fetch-tests % sh test.sh
[nodeFetch] Request => https://www.analogstudios.net/api/albums?artistId=1
[nodeFetch] Response Length (actual) => 14
[nodeFetch] Response Length (expected) => 1
FAIL
===============================================
[request] Request => https://www.analogstudios.net/api/albums?artistId=1
[request] Response Length (actual) => 1
[request] Response Length (expected) => 1
PASS
===============================================
(node:21465) ExperimentalWarning: The Fetch API is an experimental feature. This feature could change at any time
(Use `node --trace-warnings ...` to show where the warning was created)
[fetch] Request => https://www.analogstudios.net/api/albums?artistId=1
[fetch] Response Length (actual) => 14
[fetch] Response Length (expected) => 1
FAIL
===============================================
[https] Request => https://www.analogstudios.net/api/albums?artistId=1
[https] Response Length (actual) => 1
[https] Response Length (expected) => 1
PASS
===============================================
```