MCPcopy
hub / github.com/ampproject/amphtml / test

Function test

test/unit/test-impression.js:465–469  ·  view source on GitHub ↗

* Tests trust determination by referrer. * @param {string} referrer URL under test. * @param {boolean} toBeTrusted The expected outcome.

(referrer, toBeTrusted)

Source from the content-addressed store, hash-verified

463 * @param {boolean} toBeTrusted The expected outcome.
464 */
465 function test(referrer, toBeTrusted) {
466 it('testing ' + referrer, () => {
467 expect(isTrustedReferrer(referrer)).to.equal(toBeTrusted);
468 });
469 }
470
471 it('should return true for allowlisted hosts', () => {
472 test('https://t.co/docref', true);

Callers 1

test-impression.jsFile · 0.70

Calls 3

isTrustedReferrerFunction · 0.90
expectFunction · 0.85
itFunction · 0.50

Tested by

no test coverage detected