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

Function checkGlobalScope

test/integration/test-released.js:53–78  ·  view source on GitHub ↗
(win)

Source from the content-addressed store, hash-verified

51}
52
53function checkGlobalScope(win) {
54 // Checks that we don't leak certain symbols to the global scope.
55 // This could happen if we do not wrap all our code in a closure.
56 const commonSymbols = [
57 '$',
58 'a',
59 'b',
60 'c',
61 'd',
62 'e',
63 'f',
64 'g',
65 'h',
66 'i',
67 'x',
68 'z',
69 '_',
70 'log',
71 ];
72 expect(win).to.not.include.keys(commonSymbols);
73 expect(win).to.not.include.keys(
74 commonSymbols.map((symbol) => {
75 return symbol.toUpperCase();
76 })
77 );
78}

Callers 1

runTestFunction · 0.85

Calls 1

expectFunction · 0.85

Tested by

no test coverage detected