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

Supertest setup #24

Merged
merged 8 commits into from
Mar 23, 2023
Merged

Supertest setup #24

merged 8 commits into from
Mar 23, 2023

Conversation

mikolaj-pirog
Copy link
Member

Setup supertest to test http endpoints.

Split index.ts to server.ts with listen and app.ts with endpoints. This is done, so testing of endpoints will be possible without calling listen (that way supertest can assign its own port, also no need to worry about closing down the server).

It turn out that imports of ts files need to end with .js, otherwise they will not work after tsc. See server.ts

@codecov
Copy link

codecov bot commented Mar 21, 2023

Codecov Report

Patch coverage: 62.50% and project coverage change: +26.31 🎉

Comparison is base (fa7d715) 0.00% compared to head (5b1d737) 26.31%.

Additional details and impacted files
@@            Coverage Diff             @@
##            main      #24       +/-   ##
==========================================
+ Coverage   0.00%   26.31%   +26.31%     
==========================================
  Files          1        3        +2     
  Lines          8       19       +11     
==========================================
+ Hits           0        5        +5     
- Misses         8       14        +6     
Impacted Files Coverage Δ
src/server.ts 0.00% <0.00%> (ø)
src/app.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mikolaj-pirog mikolaj-pirog marked this pull request as ready for review March 21, 2023 11:48
@Kwasow Kwasow merged commit 069ac9e into main Mar 23, 2023
@Kwasow Kwasow deleted the mp_supertest branch March 23, 2023 14:21
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.

3 participants