tinyhttp icon indicating copy to clipboard operation
tinyhttp copied to clipboard

Tests TODO

Open v1rtl opened this issue 5 years ago • 45 comments

The final goal is of this issue is to achieve ~80-100% coverage

here's a todo list of things that require tests (based on the __tests__ folder):

:warning: List is in progress, I'll be adding new test tasks over time, here are some that you can submit already

  • [ ] core
    • [ ] app
      • [x] app - app.set, app.enable, app.disable (codecov)
      • [x] onError - Test a case where an error doesn't have an HTTP status code, neither is a string (codecov)
    • [ ] request
    • [ ] response
  • [ ] modules
    • [x] accepts
    • [x] cookie-signature
    • [x] cookie
    • [x] etag (#133)
    • [x] req (#140)
    • [x] res
      • [x] res.format - if default only is specified, call it as a function (codecov)
      • [x] res.format - if nothing is specified, throw 406 (codecov)
    • [ ] router
    • [x] send (#143)
  • [x] wares
    • [x] cookie-parser
    • [x] cors
      • [x] Accept a function to set origin
    • [x] dotenv
    • [x] favicon
    • [x] jwt
      • [x] Should work with different algorithms (codecov) [pending]
    • [x] logger
    • [x] ping
    • [x] bot-detector (#111)
    • [x] ip-filter
    • [x] jsonp (#123)\

If you want to help with tests, write down to this thread with your questions

v1rtl avatar Oct 01 '20 13:10 v1rtl

Thanks for improved coverage for accepts by @BRA1L0R via #97 and #99

v1rtl avatar Oct 01 '20 19:10 v1rtl

Can I try adding tests for bot-detector?

aneeshrelan avatar Oct 03 '20 07:10 aneeshrelan

@aneeshrelan yup, will create a separate issue for that now

v1rtl avatar Oct 03 '20 07:10 v1rtl

@aneeshrelan check https://github.com/talentlessguy/tinyhttp/issues/111

v1rtl avatar Oct 03 '20 08:10 v1rtl

@talentlessguy I see some tests for the mentioned wares, are they still needed?

aneeshrelan avatar Oct 03 '20 17:10 aneeshrelan

I can take up some tests

shubhi23994 avatar Oct 03 '20 17:10 shubhi23994

@shubhi23994 which tests would you like to take up? I will create a separate issue for those you pick

v1rtl avatar Oct 03 '20 17:10 v1rtl

@aneeshrelan I receive lots of PRs during hacktoberfest so I could have missed some of them

and yes, tests are still needed

v1rtl avatar Oct 03 '20 17:10 v1rtl

I can pick up jsonp to start with

shubhi23994 avatar Oct 03 '20 18:10 shubhi23994

@shubhi23994 alright, making a new issue then :D

v1rtl avatar Oct 03 '20 18:10 v1rtl

@shubhi23994 write in #123 so i can assign you

v1rtl avatar Oct 03 '20 18:10 v1rtl

Hi, may I take pick ETag?

MaurizioPz avatar Oct 06 '20 22:10 MaurizioPz

@MaurizioPz yup, pls wait a sec imma setting up a new issue for this (to later assign it to you)

v1rtl avatar Oct 07 '20 13:10 v1rtl

@MaurizioPz check this: #133

v1rtl avatar Oct 07 '20 13:10 v1rtl

Hi, may I take also req

MaurizioPz avatar Oct 08 '20 10:10 MaurizioPz

@MaurizioPz alright, making a new issue

v1rtl avatar Oct 08 '20 12:10 v1rtl

@MaurizioPz check #140 and write there pls so I can assign you

v1rtl avatar Oct 08 '20 12:10 v1rtl

Hey, @talentlessguy! I'm not familiar with the codebase, but I'm happy to try writing some tests if you still need it!

alcar avatar Oct 08 '20 20:10 alcar

@alcar hi! you can pick any of the things to test, and I'll open a separate issue for you - e.g. if you decide to test @tinyhttp/session - I'll create an issue "Write tests for @tinyhttp/session"

pick the one you want and I'll assign you to those tests

v1rtl avatar Oct 08 '20 20:10 v1rtl

Do you have any recommendations for a newcomer? If not, I can just pick up the first available one from the list!

alcar avatar Oct 08 '20 20:10 alcar

@alcar @tinyhttp/send is quite easy to test, so i'd pick that

but feel free to pick anything else

v1rtl avatar Oct 08 '20 21:10 v1rtl

@talentlessguy Sounds great! Could you please create an issue and assign it to me then?

alcar avatar Oct 08 '20 21:10 alcar

@alcar yup currently making an issue for you

v1rtl avatar Oct 08 '20 23:10 v1rtl

@alcar here you go -> #143

v1rtl avatar Oct 08 '20 23:10 v1rtl

@talentlessguy I'm happy to pick up a new one if you still need it!

alcar avatar Oct 15 '20 21:10 alcar

@alcar i will setup an issue for testing @tinyhttp/session for you tomorrow

v1rtl avatar Oct 15 '20 21:10 v1rtl

Would like to help out as well. Anything up for grabs?

KoljaTM avatar Oct 16 '20 15:10 KoljaTM

@alcar check this => https://github.com/talentlessguy/tinyhttp/issues/163

v1rtl avatar Oct 16 '20 15:10 v1rtl

@KoljaTM @tinyhttp/pug has 0% coverage so you can take it

or other modules with almost 100% coverage, such as @tinyhttp/cors

v1rtl avatar Oct 16 '20 15:10 v1rtl

ok, i'll see what i can do for the pug package

KoljaTM avatar Oct 16 '20 15:10 KoljaTM