Skip to content
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

Add tests for Bun & Small tweaks #1814

Merged
merged 5 commits into from
Nov 19, 2024
Merged

Add tests for Bun & Small tweaks #1814

merged 5 commits into from
Nov 19, 2024

Conversation

ardatan
Copy link
Owner

@ardatan ardatan commented Nov 18, 2024

  • Run Unit tests w/ Bun test runner
  • Do not fail with missing DecompressionStream and CompressionStream

Copy link
Contributor

github-actions bot commented Nov 18, 2024

@benchmarks/node-fetch results (consumeBody)

   ✓ active_handles.................: avg=139.724876 min=13      med=139     max=199     p(90)=158     p(95)=166    
     data_received..................: 22 MB  736 kB/s
     data_sent......................: 14 MB  472 kB/s
     http_req_blocked...............: avg=2.04µs     min=621ns   med=1.32µs  max=9.47ms  p(90)=1.95µs  p(95)=2.23µs 
     http_req_connecting............: avg=177ns      min=0s      med=0s      max=1.76ms  p(90)=0s      p(95)=0s     
     http_req_duration..............: avg=20.7ms     min=3.37ms  med=20.14ms max=1.03s   p(90)=25.96ms p(95)=27.97ms
       { expected_response:true }...: avg=20.7ms     min=3.37ms  med=20.14ms max=1.03s   p(90)=25.96ms p(95)=27.97ms
     http_req_failed................: 0.00%  ✓ 0           ✗ 144414
     http_req_receiving.............: avg=34.52µs    min=9.16µs  med=23.03µs max=19.86ms p(90)=37.86µs p(95)=45.07µs
     http_req_sending...............: avg=10.94µs    min=3.35µs  med=6.04µs  max=20.26ms p(90)=9.54µs  p(95)=13.28µs
     http_req_tls_handshaking.......: avg=0s         min=0s      med=0s      max=0s      p(90)=0s      p(95)=0s     
     http_req_waiting...............: avg=20.66ms    min=3.34ms  med=20.1ms  max=1.03s   p(90)=25.92ms p(95)=27.9ms 
     http_reqs......................: 144414 4813.275802/s
     iteration_duration.............: avg=41.51ms    min=10.57ms med=39.93ms max=1.06s   p(90)=46.25ms p(95)=51.41ms
     iterations.....................: 72182  2405.804658/s
     vus............................: 14     min=14        max=100 
     vus_max........................: 100    min=100       max=100 

Copy link
Contributor

github-actions bot commented Nov 18, 2024

@benchmarks/node-fetch results (noConsumeBody)

   ✓ active_handles.................: avg=139.736 min=12       med=140     max=198     p(90)=160     p(95)=164    
     data_received..................: 23 MB  768 kB/s
     data_sent......................: 15 MB  498 kB/s
     http_req_blocked...............: avg=5.24µs  min=631ns    med=1.38µs  max=14.41ms p(90)=2.02µs  p(95)=2.31µs 
     http_req_connecting............: avg=3.35µs  min=0s       med=0s      max=14.22ms p(90)=0s      p(95)=0s     
     http_req_duration..............: avg=19.83ms min=935.89µs med=19.3ms  max=1.02s   p(90)=25.03ms p(95)=26.8ms 
       { expected_response:true }...: avg=19.83ms min=935.89µs med=19.3ms  max=1.02s   p(90)=25.03ms p(95)=26.8ms 
     http_req_failed................: 0.00%  ✓ 0           ✗ 150665
     http_req_receiving.............: avg=37.69µs min=9.52µs   med=22.87µs max=26.66ms p(90)=37.9µs  p(95)=46.16µs
     http_req_sending...............: avg=13.37µs min=3.49µs   med=6.46µs  max=15.69ms p(90)=9.55µs  p(95)=13.84µs
     http_req_tls_handshaking.......: avg=0s      min=0s       med=0s      max=0s      p(90)=0s      p(95)=0s     
     http_req_waiting...............: avg=19.78ms min=848.25µs med=19.26ms max=1.02s   p(90)=24.98ms p(95)=26.71ms
     http_reqs......................: 150665 5021.442822/s
     iteration_duration.............: avg=39.78ms min=4.12ms   med=38.3ms  max=1.06s   p(90)=44.68ms p(95)=49.73ms
     iterations.....................: 75303  2509.73822/s
     vus............................: 54     min=54        max=100 
     vus_max........................: 100    min=100       max=100 

Copy link
Contributor

github-actions bot commented Nov 18, 2024

🚀 Snapshot Release (alpha)

The latest changes of this PR are available as alpha on npm (based on the declared changesets):

Package Version Info
@whatwg-node/node-fetch 0.7.3-alpha-20241119021800-e3f065ad802110966f68788462a1c5a253287f70 npm ↗︎ unpkg ↗︎
@whatwg-node/server 0.9.56-alpha-20241119021800-e3f065ad802110966f68788462a1c5a253287f70 npm ↗︎ unpkg ↗︎

Copy link
Contributor

github-actions bot commented Nov 18, 2024

@benchmarks/server results (undici)

     ✓ no-errors
     ✓ expected-result

   ✓ checks.........................: 100.00% ✓ 219746      ✗ 0     
     data_received..................: 22 MB   736 kB/s
     data_sent......................: 8.8 MB  293 kB/s
     http_req_blocked...............: avg=1.37µs   min=901ns    med=1.18µs   max=180µs    p(90)=1.85µs   p(95)=2.01µs  
     http_req_connecting............: avg=1ns      min=0s       med=0s       max=128.01µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=211.25µs min=160.61µs med=197.92µs max=42.1ms   p(90)=223.16µs p(95)=231.72µs
       { expected_response:true }...: avg=211.25µs min=160.61µs med=197.92µs max=42.1ms   p(90)=223.16µs p(95)=231.72µs
     http_req_failed................: 0.00%   ✓ 0           ✗ 109873
     http_req_receiving.............: avg=25.33µs  min=13.23µs  med=23.83µs  max=5.76ms   p(90)=30.96µs  p(95)=33.08µs 
     http_req_sending...............: avg=6.38µs   min=4.21µs   med=5.6µs    max=316.17µs p(90)=8.25µs   p(95)=8.79µs  
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=179.53µs min=133.66µs med=165.86µs max=41.99ms  p(90)=188.17µs p(95)=195.91µs
     http_reqs......................: 109873  3661.633358/s
     iteration_duration.............: avg=268.68µs min=209.35µs med=254.68µs max=42.23ms  p(90)=282.76µs p(95)=293.55µs
     iterations.....................: 109873  3661.633358/s
     vus............................: 1       min=1         max=1   
     vus_max........................: 1       min=1         max=1   

Copy link
Contributor

github-actions bot commented Nov 18, 2024

@benchmarks/server results (ponyfill)

     ✓ no-errors
     ✓ expected-result

   ✓ checks.........................: 100.00% ✓ 294822      ✗ 0     
     data_received..................: 29 MB   968 kB/s
     data_sent......................: 12 MB   393 kB/s
     http_req_blocked...............: avg=1.42µs   min=881ns   med=1.21µs   max=284.95µs p(90)=1.91µs   p(95)=2.1µs   
     http_req_connecting............: avg=0ns      min=0s      med=0s       max=122.69µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=140.85µs min=93.95µs med=135.01µs max=7.65ms   p(90)=156.36µs p(95)=162.8µs 
       { expected_response:true }...: avg=140.85µs min=93.95µs med=135.01µs max=7.65ms   p(90)=156.36µs p(95)=162.8µs 
     http_req_failed................: 0.00%   ✓ 0           ✗ 147411
     http_req_receiving.............: avg=24.77µs  min=12.79µs med=23.55µs  max=4.32ms   p(90)=30.65µs  p(95)=32.74µs 
     http_req_sending...............: avg=6.45µs   min=4.05µs  med=5.82µs   max=666.67µs p(90)=8.25µs   p(95)=8.96µs  
     http_req_tls_handshaking.......: avg=0s       min=0s      med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=109.62µs min=67.13µs med=103.35µs max=7.56ms   p(90)=121.7µs  p(95)=126.93µs
     http_reqs......................: 147411  4913.520861/s
     iteration_duration.............: avg=198.94µs min=140.3µs med=192.47µs max=8.48ms   p(90)=216.74µs p(95)=225.59µs
     iterations.....................: 147411  4913.520861/s
     vus............................: 1       min=1         max=1   
     vus_max........................: 1       min=1         max=1   

Copy link
Contributor

github-actions bot commented Nov 18, 2024

@benchmarks/server results (native)

     ✓ no-errors
     ✓ expected-result

   ✓ checks.........................: 100.00% ✓ 234610      ✗ 0     
     data_received..................: 24 MB   786 kB/s
     data_sent......................: 9.4 MB  313 kB/s
     http_req_blocked...............: avg=1.45µs   min=911ns    med=1.23µs   max=271.16µs p(90)=1.97µs   p(95)=2.16µs  
     http_req_connecting............: avg=1ns      min=0s       med=0s       max=130.01µs p(90)=0s       p(95)=0s      
     http_req_duration..............: avg=193.35µs min=145.87µs med=182.79µs max=49.73ms  p(90)=207.44µs p(95)=216.67µs
       { expected_response:true }...: avg=193.35µs min=145.87µs med=182.79µs max=49.73ms  p(90)=207.44µs p(95)=216.67µs
     http_req_failed................: 0.00%   ✓ 0           ✗ 117305
     http_req_receiving.............: avg=25.58µs  min=13.59µs  med=24.34µs  max=572.05µs p(90)=31.26µs  p(95)=33.2µs  
     http_req_sending...............: avg=6.42µs   min=4.24µs   med=5.75µs   max=114.67µs p(90)=8.24µs   p(95)=8.87µs  
     http_req_tls_handshaking.......: avg=0s       min=0s       med=0s       max=0s       p(90)=0s       p(95)=0s      
     http_req_waiting...............: avg=161.34µs min=118.86µs med=150.34µs max=49.66ms  p(90)=172.36µs p(95)=180.77µs
     http_reqs......................: 117305  3910.036832/s
     iteration_duration.............: avg=251.26µs min=198.72µs med=239.77µs max=49.87ms  p(90)=267.57µs p(95)=279.11µs
     iterations.....................: 117305  3910.036832/s
     vus............................: 1       min=1         max=1   
     vus_max........................: 1       min=1         max=1   

@ardatan ardatan requested a review from enisdenjo November 19, 2024 02:34
@ardatan ardatan changed the title Add tests for Bun Add tests for Bun & Small tweaks Nov 19, 2024
Comment on lines +81 to +86
try {
await body.formData();
expect(true).toBe(false);
} catch (e) {
expect(e).toBeInstanceOf(TypeError);
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, why isnt the original code working? bun test does not support it?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bun test does not support it :/

@ardatan ardatan merged commit 54c244d into master Nov 19, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants