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 / src / views / scriptHashes.spec.js
Size: Mime:
import scriptHashes from './scriptHashes';

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

        scriptHashes.forEach(hash => {
            const prefix = hash.substr(0, 7);
            expect(allowedPrefix).toContain(prefix);

            // Our base64 hashes should be 44 characters long.
            expect(hash.length - prefix.length).toBe(44);
        })
    });
});