MCPcopy Index your code
hub / github.com/ampproject/amphtml / testLocalhostOrigin

Function testLocalhostOrigin

test/unit/test-url.js:604–614  ·  view source on GitHub ↗
(href, bool)

Source from the content-addressed store, hash-verified

602
603describes.sandboxed('isLocalhostOrigin', {}, () => {
604 function testLocalhostOrigin(href, bool) {
605 it(
606 'should return that ' +
607 href +
608 (bool ? ' is' : ' is not') +
609 ' a localhost origin',
610 () => {
611 expect(isLocalhostOrigin(parseUrlDeprecated(href))).to.equal(bool);
612 }
613 );
614 }
615
616 testLocalhostOrigin('http://localhost', true);
617 testLocalhostOrigin('https://localhost', true);

Callers 1

test-url.jsFile · 0.85

Calls 4

isLocalhostOriginFunction · 0.90
parseUrlDeprecatedFunction · 0.90
expectFunction · 0.85
itFunction · 0.50

Tested by

no test coverage detected