Repository URL to install this package:
|
Version:
1.4.3 ▾
|
"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);
});
});
});