const customembed = require('../lib/customembed'); const assert = require('assert'); const crypto = require("crypto"); function sha256(input) { let hash = crypto.createHash('sha256'); hash.update(input); return hash.digest('base64'); } describe('customembed', () => { describe('#filter', () => { it('rejects inputs', () => { const input = ''; assert.throws(() => { customembed.filter(input) }, /must be an '; assert.throws(() => { customembed.filter(input) }, /must be HTTPS/); }); it('accepts a valid iframe', () => { let input = '