Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
@doodle/tagmanager / views / scriptHashes.spec.js
Size: Mime:
"use strict";

var _scriptHashes = _interopRequireDefault(require("./scriptHashes"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

describe('getScriptHashes', function () {
  test('it gets an array', function () {
    expect(Array.isArray(_scriptHashes.default)).toEqual(true);
  });
  test('it returns well-formed string hashes', function () {
    expect.assertions(_scriptHashes.default.length * 2);
    var allowedPrefix = ['sha256-', 'sha384-', 'sha512-'];

    _scriptHashes.default.forEach(function (hash) {
      var prefix = hash.substr(0, 7);
      expect(allowedPrefix).toContain(prefix); // Our base64 hashes should be 44 characters long.

      expect(hash.length - prefix.length).toBe(44);
    });
  });
});