update dependencies and devDependencies
[squeep-authentication-module] / test / lib / common.js
index 921479ce839b49c1b569f958d501e52d701116f0..82b80f0db7a18f7e1ef35b2b13bccdec18d671a0 100644 (file)
@@ -49,7 +49,7 @@ describe('Common', function () {
     afterEach(function () {
       sinon.restore();
     });
-      it('covers', function () {
+    it('covers', function () {
       const stat = {
         packageName: 'fake-mystery-box',
         packageVersion: '0.0.0',
@@ -61,4 +61,21 @@ describe('Common', function () {
     });
   }); // mysteryBoxLogger
 
+  describe('obscureAuthorizationHeader', function () {
+    it('blurs Bearer token', function () {
+      const result = common.obscureAuthorizationHeader('Bearer foo');
+      assert.strictEqual(result, 'Bearer ***');
+    });
+    it('blurs entire string for other', function () {
+      const result = common.obscureAuthorizationHeader('abcdef');
+      assert.strictEqual(result, '******');
+    });
+    it('covers empty string', function () {
+      const a = '';
+      const result = common.obscureAuthorizationHeader(a);
+      assert.strictEqual(result, a);
+
+    });
+  });
+
 }); // Common
\ No newline at end of file