-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Test static route #3297
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
Test static route #3297
Conversation
Codecov Report
@@ Coverage Diff @@
## main #3297 +/- ##
==========================================
+ Coverage 56.95% 58.95% +1.99%
==========================================
Files 35 35
Lines 1703 1703
Branches 374 374
==========================================
+ Hits 970 1004 +34
+ Misses 583 561 -22
+ Partials 150 138 -12
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! 🚀
Mostly nits around test names and then a question
b44ba1e
to
e382328
Compare
I need to refactor the logger module mock because it causes errors in the e2e tests (now that the terminal test imports the helper file) but that conflicts with some constant test changes you're making so I'm going to wait for that to get merged then rebase. |
This is to match the other tests that create temp directories. It also lets you clean up test temp directories all at once separately from other non-test temporary directories.
Just to limit all the noise from code-server's startup output.
01f695f
to
eb34f4b
Compare
It errors that jest is not defined so put it behind a function instead of immediately creating the mock (this is probably a better pattern anyway). The constant tests had to be reworked a little. Since the logger mock is hoisted it runs before createLoggerMock is imported. I moved it into a beforeAll which means the require call also needed to be moved there (since we need to mock the logger before requiring the constants or it'll pull the non-mocked logger). This means getPackageJson needs to be a let and assigned afterward. To avoid having to define a type for getPackageJson I just added a let var set to the type of the imported constants file and modified the other areas to use the same paradigm. I also replaced some hardcoded strings with the mocked package.json object.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work!
Mostly just wanted to add a test for static auth.