Commit Graph

10 Commits

Author SHA1 Message Date
kgarg1
b8ab46594d
test: add coverage for app.listen() variants (#6476)
Some checks failed
ci / Lint (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (18, ubuntu-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (18, windows-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (19, ubuntu-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (19, windows-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (20, ubuntu-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (20, windows-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (21, ubuntu-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (21, windows-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (22, ubuntu-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (22, windows-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (23, ubuntu-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (23, windows-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (24, ubuntu-latest) (push) Has been cancelled
ci / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (24, windows-latest) (push) Has been cancelled
CodeQL / Analyze (actions) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
legacy / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (16, ubuntu-latest) (push) Has been cancelled
legacy / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (16, windows-latest) (push) Has been cancelled
legacy / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (17, ubuntu-latest) (push) Has been cancelled
legacy / Node.js ${{ matrix.node-version }} - ${{matrix.os}} (17, windows-latest) (push) Has been cancelled
Scorecard supply-chain security / Scorecard analysis (push) Has been cancelled
ci / coverage (push) Has been cancelled
legacy / coverage (push) Has been cancelled
* test: add coverage for app.listen() variants

- verify alternate signatures (port+host+backlog)
- verify server.address() shape

* fix linter issue

---------

Co-authored-by: kuldeep <kuldeep@wanclouds.net>
2025-05-28 19:26:16 -05:00
Szymon Łągiewka
41113599af fix(refactor): prefix built-in node module imports
Since v5 relies on node >= 18, this is now possible (since v16, v14.18.0
[^1][^2]).

It's functionally irrelevant:
1. It's not required for CJS nor ESM (with a few exceptions [^3])
2. It has no performance promises

However, there are upsides to this approach:
1. It brings clear boundaries to what's a built-in and what's an
external dependency
2. It reduces the risk of importing unwanted deps where a built-in is
expected
3. It's slightly more interoperable with other JS runtimes that provide
node compatibility[^4], albeit only during development. Once imported
from npm, built-ins are assumed.

[^1]:https://nodejs.org/docs/latest-v22.x/api/modules.html#built-in-modules
[^2]:https://github.com/nodejs/node/pull/37246
[^3]:https://nodejs.org/api/modules.html#built-in-modules-with-mandatory-node-prefix
[^4]:https://docs.deno.com/runtime/fundamentals/node/#using-node's-built-in-modules
2025-01-10 11:53:44 -06:00
Wes
ee40a881f5 call callback once on listen error 2024-05-17 13:47:56 -07:00
Raz Luvaton
2a00da2067 tests: use random port in listen test
closes #5162
2023-06-04 11:47:20 -04:00
Douglas Christopher Wilson
8c24fa8f7b tests: wait for server close in app.listen() 2023-03-13 22:43:19 -04:00
Douglas Christopher Wilson
a65913776d tests: use strict mode 2022-02-09 01:07:08 -05:00
Juan José Arboleda
dab6ee5822 tests: remove extraneous code from app.listen test
closes #4714
2021-11-15 23:56:46 -05:00
Douglas Christopher Wilson
e0066227f7 lint: remove all unused varaibles 2017-08-06 00:19:32 -04:00
Jonathan Ong
643397ed21 remove unnecessary test/support/http 2014-03-05 22:06:14 -08:00
Tj Holowaychuk
9082e74971 Added app.listen() as a shortcut for http.createServer(app).listen() 2011-11-11 17:22:25 -08:00