[{"data":1,"prerenderedAt":215},["ShallowReactive",2],{"navigation_docs":3,"-fake-browser-reseting-state":133,"-fake-browser-reseting-state-surround":212},[4,22,51,62,73,84,99,118],{"title":5,"path":6,"stem":7,"children":8,"page":21},"Get Started","/get-started","0.get-started",[9,13,17],{"title":10,"path":11,"stem":12},"Introduction","/get-started/introduction","0.get-started/0.introduction",{"title":14,"path":15,"stem":16},"Browser Support","/get-started/browser-support","0.get-started/1.browser-support",{"title":18,"path":19,"stem":20},"Contributing","/get-started/contributing","0.get-started/2.contributing",false,{"title":23,"path":24,"stem":25,"children":26,"page":21},"Fake Browser","/fake-browser","fake-browser",[27,31,35,39,43,47],{"title":28,"path":29,"stem":30},"Installation","/fake-browser/installation","fake-browser/0.installation",{"title":32,"path":33,"stem":34},"Testing Frameworks","/fake-browser/testing-frameworks","fake-browser/1.testing-frameworks",{"title":36,"path":37,"stem":38},"Triggering Events","/fake-browser/triggering-events","fake-browser/2.triggering-events",{"title":40,"path":41,"stem":42},"Resetting State","/fake-browser/reseting-state","fake-browser/3.reseting-state",{"title":44,"path":45,"stem":46},"Implemented Apis","/fake-browser/implemented-apis","fake-browser/4.implemented-apis",{"title":48,"path":49,"stem":50},"Api","/fake-browser/api","fake-browser/api",{"title":52,"path":53,"stem":54,"children":55,"page":21},"Isolated Element","/isolated-element","isolated-element",[56,59],{"title":28,"path":57,"stem":58},"/isolated-element/installation","isolated-element/0.installation",{"title":48,"path":60,"stem":61},"/isolated-element/api","isolated-element/api",{"title":63,"path":64,"stem":65,"children":66,"page":21},"Job Scheduler","/job-scheduler","job-scheduler",[67,70],{"title":28,"path":68,"stem":69},"/job-scheduler/installation","job-scheduler/0.installation",{"title":48,"path":71,"stem":72},"/job-scheduler/api","job-scheduler/api",{"title":74,"path":75,"stem":76,"children":77,"page":21},"Match Patterns","/match-patterns","match-patterns",[78,81],{"title":28,"path":79,"stem":80},"/match-patterns/installation","match-patterns/0.installation",{"title":48,"path":82,"stem":83},"/match-patterns/api","match-patterns/api",{"title":85,"path":86,"stem":87,"children":88,"page":21},"Messaging","/messaging","messaging",[89,92,96],{"title":28,"path":90,"stem":91},"/messaging/installation","messaging/0.installation",{"title":93,"path":94,"stem":95},"Protocol Maps","/messaging/protocol-maps","messaging/1.protocol-maps",{"title":48,"path":97,"stem":98},"/messaging/api","messaging/api",{"title":100,"path":101,"stem":102,"children":103,"page":21},"Proxy Service","/proxy-service","proxy-service",[104,107,111,115],{"title":28,"path":105,"stem":106},"/proxy-service/installation","proxy-service/0.installation",{"title":108,"path":109,"stem":110},"Defining Services","/proxy-service/defining-services","proxy-service/1.defining-services",{"title":112,"path":113,"stem":114},"Service Keys","/proxy-service/service-keys","proxy-service/2.service-keys",{"title":48,"path":116,"stem":117},"/proxy-service/api","proxy-service/api",{"title":119,"path":120,"stem":121,"children":122,"page":21},"Storage","/storage","storage",[123,126,130],{"title":28,"path":124,"stem":125},"/storage/installation","storage/0.installation",{"title":127,"path":128,"stem":129},"Typescript","/storage/typescript","storage/1.typescript",{"title":48,"path":131,"stem":132},"/storage/api","storage/api",{"id":134,"title":40,"body":135,"description":203,"extension":206,"links":207,"meta":208,"navigation":209,"path":41,"seo":210,"stem":42,"__hash__":211},"docs/fake-browser/3.reseting-state.md",{"type":136,"value":137,"toc":202},"minimark",[138,142,166,170,177,189,192],[139,140,141],"p",{},"Implemented APIs store state in memory. When unit testing, we often want to reset all that state before each test so each test has a blank state. There are 3 ways to reset that in-memory state:",[143,144,145,153,159],"ol",{},[146,147,148,149],"li",{},"Reset everything: ",[150,151,152],"code",{},"fakeBrowser.reset()",[146,154,155,156],{},"Reset just one API: ",[150,157,158],{},"fakeBrowser.{api}.resetState()",[146,160,161,162,165],{},"Call ",[150,163,164],{},"fakeBrowser.{api}.on{Event}.removeAllListeners()"," to remove all the listeners setup for an event",[167,168,169],"alert",{},"All the reset methods are synchronous",[139,171,172,173,176],{},"For example, to clear the in-memory stored values for ",[150,174,175],{},"browser.storage.local",", you could call any of the following:",[178,179,180,184],"ul",{},[146,181,182],{},[150,183,152],{},[146,185,186],{},[150,187,188],{},"fakeBrowser.storage.resetState()",[139,190,191],{},"All these reset methods should show up in your editor's intellisense.",[167,193,194,195,197,198,201],{},"Generally, you should put a call to ",[150,196,152],{}," in a ",[150,199,200],{},"beforeEach"," block to cleanup the state before every test.",{"title":203,"searchDepth":204,"depth":204,"links":205},"",2,[],"md",null,{},true,{"title":40,"description":203},"Zqy5zgNsjavfhSruS3X8tCHI5XIkz5sYLAjil74Ubpk",[213,214],{"title":36,"path":37,"stem":38,"description":203,"children":-1},{"title":44,"path":45,"stem":46,"description":203,"children":-1},1779298143549]