MCPcopy Create free account
hub / github.com/ampproject/amphtml / testStandalone

Function testStandalone

test/unit/test-platform.js:49–58  ·  view source on GitHub ↗
(userAgentString, standAloneBoolean)

Source from the content-addressed store, hash-verified

47 }
48
49 function testStandalone(userAgentString, standAloneBoolean) {
50 const platform = new Platform({
51 navigator: {
52 standalone: standAloneBoolean,
53 userAgent: userAgentString,
54 },
55 matchMedia: env.sandbox.stub().returns({matches: true}),
56 });
57 expect(platform.isStandalone()).to.equal(isStandalone);
58 }
59
60 it('should tolerate empty or null', () => {
61 testUserAgent(null);

Callers 1

test-platform.jsFile · 0.85

Calls 2

isStandaloneMethod · 0.95
expectFunction · 0.85

Tested by

no test coverage detected