potentially serve static files with static headers
[squeep-api-dingus] / test / lib / common.js
index b802003af74c0a50d5a9ecf538c364df8eb682b7..a04bf614eeadac136f2df8ff44cf1519846d8221 100644 (file)
@@ -258,7 +258,6 @@ describe('common', function () {
     });
   }); // requestId
 
-
   describe('ensureLoggerLevels', function () {
     it('adds missing levels', function () {
       const result = common.ensureLoggerLevels();
@@ -378,4 +377,26 @@ describe('common', function () {
     });
   }); // mergeDeep
 
+  describe('unfoldHeaderLines', function () {
+    it('folds', function () {
+      const lines = [
+        'Normal-Header: some header data',
+        'Folded-Header: more data',
+        '   second line of data',
+        '   third line of data',
+      ];
+      const expected = [
+        'Normal-Header: some header data',
+        'Folded-Header: more data second line of data third line of data',
+      ];
+      const result = common.unfoldHeaderLines(lines);
+      assert.deepStrictEqual(result, expected);
+    });
+    it('covers no input', function () {
+      const lines = undefined;
+      const result = common.unfoldHeaderLines();
+      assert.deepStrictEqual(result, lines);
+    });
+  }); // unfoldHeaderLines
+
 });