UNPKG

alagarr

Version:

Alagarr is a request-response helper library that removes the boilerplate from your Node.js serverless functions and helps make your code portable.

20 lines (19 loc) 711 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const content_length_1 = __importDefault(require("./content-length")); const testTextBody = 'foobar'; describe('Response content-length header', () => { test('is set correctly', () => { const { headers } = content_length_1.default({ body: testTextBody, headers: { 'content-type': 'text/plain', }, statusCode: 200, }); expect(headers['content-length']).toBe(Buffer.byteLength(testTextBody)); }); });