| 305 | }); |
| 306 | |
| 307 | function testClone(request) { |
| 308 | it('should return a new instance with the same properties', function () { |
| 309 | const cloned = request.clone(); |
| 310 | assert.notStrictEqual(request, cloned); |
| 311 | Object.keys(request).forEach(function (key) { |
| 312 | assert.strictEqual(request[key], cloned[key]); |
| 313 | }); |
| 314 | }); |
| 315 | it('should generate the same buffer', function () { |
| 316 | const cloned = request.clone(); |
| 317 | assert.strictEqual( |
| 318 | request.write(encoder, 1).toString(), |
| 319 | cloned.write(encoder, 1).toString() |
| 320 | ); |
| 321 | }); |
| 322 | } |
| 323 | |
| 324 | function testRequestLength(requestGetter) { |
| 325 | it('should set the length of the body of the request', () => { |