+ body: 'Old Mother West Wind had stopped to talk with the Slender Fir Tree. "I\'ve just come across the Green... (184 bytes)',
+ };
+ const result = common.gotResponseLogData(response);
+ assert.deepStrictEqual(result, expected);
+ });
+ it('covers no body', function () {
+ const response = {
+ statusCode: 200,
+ statusMessage: 'OK',
+ headers: {
+ 'Content-Type': 'text/plain',
+ },
+ timings: {
+ phases: {
+ total: 89,
+ },
+ },
+ retryCount: 1,
+ };
+ const expected = {
+ statusCode: 200,
+ statusMessage: 'OK',
+ headers: {
+ 'Content-Type': 'text/plain',
+ },
+ elapsedTimeMs: 89,
+ retryCount: 1,
+ };
+ const result = common.gotResponseLogData(response);
+ assert.deepStrictEqual(result, expected);
+ });
+ it('covers json', function () {
+ const response = {
+ statusCode: 200,
+ statusMessage: 'OK',
+ headers: {
+ 'Content-Type': 'application/json',
+ },
+ timings: {
+ phases: {
+ total: 89,
+ },
+ },
+ body: {
+ foo: 'bar',
+ },
+ redirectUrls: ['https://redirect.example.com/'],