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.
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 <jonathan@coder.com>
Co-authored-by: Asher <ash@coder.com>
…-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 <jonathan@coder.com> * Update src/node/app.ts Co-authored-by: Asher <ash@coder.com> Co-authored-by: Jonathan Yu <jonathan@coder.com> Co-authored-by: Asher <ash@coder.com>
This PR adds a new test to handle test when
fs.unlinkthrows insidelisten.Fixes #4913