-
Notifications
You must be signed in to change notification settings - Fork 6k
feat(testing): add test for app > listen #4971
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
feat(testing): add test for app > listen #4971
Conversation
✨ code-server docs for PR #4971 is ready! It will be updated on every commit.
|
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.
Test looks great. I wonder if we should actually throw on any non-ENOENT error here instead of just logging because otherwise we get:
[2022-03-10T19:08:49.832Z] error EISDIR: illegal operation on a directory, unlink '/home/coder'
[2022-03-10T19:08:49.835Z] error listen EADDRINUSE: address already in use /home/coder
Which feels to me not quite correct, /home/coder
is not already in use, it is just not valid because it is a directory.
Great suggestion! I like correct better. I'll update the code and the test. (test first of course 😉 ) |
Codecov Report
@@ Coverage Diff @@
## main #4971 +/- ##
==========================================
+ Coverage 71.45% 71.58% +0.12%
==========================================
Files 29 29
Lines 1678 1675 -3
Branches 373 373
==========================================
Hits 1199 1199
+ Misses 408 405 -3
Partials 71 71
Continue to review full report at Codecov.
|
…-is-called-on-unlink-error
…-is-called-on-unlink-error
Major changes made, need a new approval
Co-authored-by: Jonathan Yu <[email protected]>
Co-authored-by: Asher <[email protected]>
…-is-called-on-unlink-error
* feat(testing): add test for app > listen * Update test/unit/node/app.test.ts * refactor: modernize listen fn in app * wip * fix: update error message * fixup: remove console.log * fixup: use clearAllMocks once in beforeAll * fix: move chmod after socket listen * fixup: formatting * Update src/node/app.ts Co-authored-by: Jonathan Yu <[email protected]> * Update src/node/app.ts Co-authored-by: Asher <[email protected]> Co-authored-by: Jonathan Yu <[email protected]> Co-authored-by: Asher <[email protected]>
This PR adds a new test to handle test when
fs.unlink
throws insidelisten
.Fixes #4913