koajs/compress

"flush" as it is used in tests

uhop opened this issue · 1 comments

uhop commented

In __tests__.index.js there is a section:

it('should support Z_SYNC_FLUSH', (done) => {
  const app = new Koa()

  app.use(compress({
    flush: zlib.constants.Z_SYNC_FLUSH
  }))
  // and so on
})

Is flush really a top-level option? Or should it be:

app.use(compress({
  gzip: { // or deflate?
    flush: zlib.constants.Z_SYNC_FLUSH
  }
}))

The test succeeds anyway: with the existing code, with added gzip, even when the flush line is commented out.

I don't know what effects should be tested but it looks like they are not observed. I think it should be clarified and the test updated.

you're right. the test doesn't actually do anything, so I'll delete it. feel free to make a new test if you would like.