koajs / koala

[SEEKING MAINTAINER] An HTTP/2 and ES6 Module-ready Koa Suite
MIT License
320 stars 27 forks source link

Tests fail on Node 6 #28

Closed nickserv closed 7 years ago

nickserv commented 8 years ago

Node'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.
jonathanong commented 8 years ago

sorry, haven't maintained this in a while. i'm sure there are a lot of issues with this repo. are you interested in maintaining it?

richenlin commented 7 years ago

I'm interested

nickserv commented 7 years ago

I'm not sure I can take over all maintenance, but I'm at least interesting in helping out. Is there a plan or a set of blocking issues for Koa 2 and modern Node support?

doug-wade commented 7 years ago

This seems to be specific to node 6

i-200077 foss/koala ‹master*› » node -v
v8.4.0
i-200077 foss/koala ‹master*› » npm test

> koala@1.0.0 test /Users/dwade/foss/koala
> NODE_ENV=test mocha --reporter spec --timeout 30s --bail test/app/index.js

  Basic Auth
    ✓ should return the value

  Body Parsing
    .request.json()
      ✓ should parse a json body
      ✓ should throw on non-objects in strict mode
      ✓ should not throw on non-objects in non-strict mode
    .request.urlencoded()
      ✓ should parse a urlencoded body
      ✓ should not support nested query strings by default
      ✓ should support nested query strings with options.qs=true
    .request.text()
      ✓ should get the raw text body
      ✓ should throw if the body is too large
    .request.buffer()
      ✓ should get the raw buffer body
      ✓ should throw if the body is too large
    Expect: 100-continue
      ✓ should send 100-continue

  Cache-Control
    should be available as
      ✓ this.cc()
      ✓ this.cacheControl()
      ✓ this.response.cc()
      ✓ this.cacheControl()
    when the value is a number
      ✓ should set "public, max-age="
    when the value is a time string
      ✓ should set "public, max-age="
    when the value is "false"
      ✓ should set "private, no-cache"
    when the value is a string
      ✓ should juset set it
    when the value is anything else
      ✓ should throw

  Conditional-Get
    when a body is set
      ✓ should set an etag
      ✓ should response 304 w/ if-none-match header

  Set headers
    X-Response-Time
      ✓ should get X-Response-Time correctly by default
      ✓ should not get X-Response-Time by options.responseTime = false
    X-Frame-Options
      ✓ should get X-Frame-Options DENY by default
      ✓ should not get X-Frame-Options by xframe = false
      ✓ should get X-Frame-Options DENY by xframe = true
      ✓ should get X-Frame-Options SAMEORIGIN by xframe = same

  jsonp
    ✓ should return jsonp response
    ✓ should return json response

  Middlewares
    Session
      ✓ should has this.session by default
      ✓ should has no this.session by options.session = false

  Object Streams
    ✓ should be supported

  Polyfills
    GET /polyfill.js
      - should return the polyfill

  Nested Query Strings
    when options.qs = false
      ✓ should not support nested query strings
    when options.qs = true
      ✓ should support nested query strings

  36 passing (280ms)
  1 pending
nickserv commented 7 years ago

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.