diff options
author | Evan Lucas <evanlucas@me.com> | 2017-08-10 17:00:01 -0500 |
---|---|---|
committer | Evan Lucas <evanlucas@me.com> | 2017-08-14 10:06:01 -0500 |
commit | b2a9b81738a77bd4dc63926d74cc4f037a3cb43c (patch) | |
tree | 9711d125503be524c71ccc29b26eed28147d9bdc /test | |
parent | 85d7d97d8165dbd94a57ed4dbe143c745487ff8c (diff) | |
download | android-node-v8-b2a9b81738a77bd4dc63926d74cc4f037a3cb43c.tar.gz android-node-v8-b2a9b81738a77bd4dc63926d74cc4f037a3cb43c.tar.bz2 android-node-v8-b2a9b81738a77bd4dc63926d74cc4f037a3cb43c.zip |
http2: fix [kInspect]() output for Http2Stream
This fixes a typo in the util.inspect output of Http2Stream. It
previously had writeableSate instead of writableState.
PR-URL: https://github.com/nodejs/node/pull/14753
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/parallel/test-http2-stream-client.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/parallel/test-http2-stream-client.js b/test/parallel/test-http2-stream-client.js new file mode 100644 index 0000000000..658c66ce7a --- /dev/null +++ b/test/parallel/test-http2-stream-client.js @@ -0,0 +1,29 @@ +// Flags: --expose-http2 +'use strict'; + +const common = require('../common'); +if (!common.hasCrypto) + common.skip('missing crypto'); +const assert = require('assert'); +const http2 = require('http2'); +const util = require('util'); + +const server = http2.createServer(); +server.on('stream', common.mustCall((stream) => { + assert.strictEqual(stream.aborted, false); + const insp = util.inspect(stream); + assert.ok(/Http2Stream { id/.test(insp)); + assert.ok(/ state:/.test(insp)); + assert.ok(/ readableState:/.test(insp)); + assert.ok(/ writableState:/.test(insp)); + stream.end('ok'); +})); +server.listen(0, common.mustCall(() => { + const client = http2.connect(`http://localhost:${server.address().port}`); + const req = client.request(); + req.resume(); + req.on('streamClosed', common.mustCall(() => { + client.destroy(); + server.close(); + })); +})); |