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

Function expectExperiment

test/unit/test-experiments.js:134–139  ·  view source on GitHub ↗
(storedString, experimentId)

Source from the content-addressed store, hash-verified

132 });
133
134 function expectExperiment(storedString, experimentId) {
135 resetExperimentTogglesForTesting(win);
136 win.localStorage.setItem('amp-experiment-toggles', storedString);
137 // eslint-disable-next-line chai-expect/missing-assertion
138 return expect(isExperimentOn(win, /*OK*/ experimentId));
139 }
140
141 describe('with only cookie flag', () => {
142 it('should return "off" with no cookies, malformed or empty', () => {

Callers 1

Calls 4

expectFunction · 0.85
setItemMethod · 0.80
isExperimentOnFunction · 0.50

Tested by

no test coverage detected