Tests fail on Node 6
See original GitHub issueNode’s net library has a breaking change in Node 6, which performs validation on the port in the listen method.
~/Repos/koala → npm test
> koala@1.0.0 test /Users/nick/Repos/koala
> NODE_ENV=test mocha --reporter spec --timeout 30s --bail test/app/index.js
internal/net.js:17
throw new RangeError('"port" argument must be >= 0 and < 65536');
^
RangeError: "port" argument must be >= 0 and < 65536
at assertPort (internal/net.js:17:11)
at Server.listen (net.js:1384:5)
at Application.listen (/Users/nick/Repos/koala/lib/app.js:19:12)
at Suite.<anonymous> (/Users/nick/Repos/koala/test/app/conditional-get.js:11:22)
at context.describe.context.context (/Users/nick/Repos/koala/node_modules/mocha/lib/interfaces/bdd.js:47:10)
at Suite.<anonymous> (/Users/nick/Repos/koala/test/app/conditional-get.js:3:3)
at context.describe.context.context (/Users/nick/Repos/koala/node_modules/mocha/lib/interfaces/bdd.js:47:10)
at Object.<anonymous> (/Users/nick/Repos/koala/test/app/conditional-get.js:2:1)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
npm ERR! Test failed. See above for more details.
Issue Analytics
- State:
- Created 7 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Unit tests fail on Node.js v14.x and v15.x - Check ... - GitHub
When using the latest Node.js LTS Fermium v14.15.0, the unit test began to fail consistently and it also reproduces on v15.x versions.
Read more >Tests randomly failing with jest and node - Stack Overflow
When running this test, it sometimes fails with res.code being 0 instead of 127. When testing without jest, it works flawlessly 100% of...
Read more >Testing Error Handling in node.js | by Lars Trieloff
Testing Error Handling in node.js · 1. Don't let yourself get away with less than 100% · 2. Always assert the exception ·...
Read more >Test runner with Nodejs and Jest not working with 17.1
Anyways, I was able to get basic tests running and showing fail messages with a couple simple changes. I do not guarantee this...
Read more >Mocha - the fun, simple, flexible JavaScript test framework
simple, flexible, fun. Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This seems to be specific to node 6
Good catch. See #37 for troubleshooting, it’s only failing on 6. I would definitely still want to fix this because it’s the current LTS version.