diff options
author | Matteo Collina <hello@matteocollina.com> | 2017-07-24 18:34:17 +0100 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2017-08-04 12:56:50 -0700 |
commit | a4017736d213a580a8bdd1ac3184e74d29b87d67 (patch) | |
tree | 656ffd377232a6ab5624c720f5d0b7ec916dc3d9 /test/parallel/test-http2-compat-serverresponse-createpushresponse.js | |
parent | d6a774b1bd2c7ccbd783b06a95f6eeeb8dca210c (diff) | |
download | node-new-a4017736d213a580a8bdd1ac3184e74d29b87d67.tar.gz |
http2: doc and fixes to the Compatibility API
PR-URL: https://github.com/nodejs/node/pull/14239
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Diffstat (limited to 'test/parallel/test-http2-compat-serverresponse-createpushresponse.js')
-rw-r--r-- | test/parallel/test-http2-compat-serverresponse-createpushresponse.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/parallel/test-http2-compat-serverresponse-createpushresponse.js b/test/parallel/test-http2-compat-serverresponse-createpushresponse.js index 68e438d62f..9679215abb 100644 --- a/test/parallel/test-http2-compat-serverresponse-createpushresponse.js +++ b/test/parallel/test-http2-compat-serverresponse-createpushresponse.js @@ -22,6 +22,16 @@ const server = h2.createServer((request, response) => { assert.strictEqual(push.stream.id % 2, 0); push.end(pushExpect); response.end(); + + // wait for a tick, so the stream is actually closed + setImmediate(function() { + response.createPushResponse({ + ':path': '/pushed', + ':method': 'GET' + }, common.mustCall((error) => { + assert.strictEqual(error.code, 'ERR_HTTP2_STREAM_CLOSED'); + })); + }); })); }); |