summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2017-11-25 12:44:07 -0800
committerJames M Snell <jasnell@gmail.com>2017-11-28 10:30:34 -0800
commitdf33d8d0b39be893ad7864cc5e1b65bc448ba1f4 (patch)
treeeff94250f7833b571514db7e866c1373fa323ca4 /test
parentd4111d0286638ed97bd230dd38afc065d7b2017d (diff)
downloadandroid-node-v8-df33d8d0b39be893ad7864cc5e1b65bc448ba1f4.tar.gz
android-node-v8-df33d8d0b39be893ad7864cc5e1b65bc448ba1f4.tar.bz2
android-node-v8-df33d8d0b39be893ad7864cc5e1b65bc448ba1f4.zip
http2: reduce code duplication in settings
PR-URL: https://github.com/nodejs/node/pull/17328 Fixes: https://github.com/nodejs/node/issues/15303 Reviewed-By: Anatoli Papirovski <apapirovski@mac.com> Reviewed-By: Sebastiaan Deckers <sebdeckers83@gmail.com>
Diffstat (limited to 'test')
-rw-r--r--test/parallel/test-http2-getpackedsettings.js10
1 files changed, 2 insertions, 8 deletions
diff --git a/test/parallel/test-http2-getpackedsettings.js b/test/parallel/test-http2-getpackedsettings.js
index 7461176c5f..16c8491389 100644
--- a/test/parallel/test-http2-getpackedsettings.js
+++ b/test/parallel/test-http2-getpackedsettings.js
@@ -128,7 +128,6 @@ assert.doesNotThrow(() => http2.getPackedSettings({ enablePush: false }));
assert.strictEqual(settings.enablePush, true);
}
-//should throw if enablePush is not 0 or 1
{
const packed = Buffer.from([
0x00, 0x02, 0x00, 0x00, 0x00, 0x00]);
@@ -140,13 +139,8 @@ assert.doesNotThrow(() => http2.getPackedSettings({ enablePush: false }));
const packed = Buffer.from([
0x00, 0x02, 0x00, 0x00, 0x00, 0x64]);
- assert.throws(() => {
- http2.getUnpackedSettings(packed, { validate: true });
- }, common.expectsError({
- code: 'ERR_HTTP2_INVALID_SETTING_VALUE',
- type: RangeError,
- message: 'Invalid value for setting "enablePush": 100'
- }));
+ const settings = http2.getUnpackedSettings(packed, { validate: true });
+ assert.strictEqual(settings.enablePush, true);
}
//check for what happens if passing {validate: true} and no errors happen