[{"data":1,"prerenderedAt":209},["ShallowReactive",2],{"navigation_docs":3,"-fake-browser-reseting-state":127,"-fake-browser-reseting-state-surround":206},[4,22,51,62,73,84,99,115],{"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 Reference","/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],{"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":116,"path":117,"stem":118,"children":119,"page":21},"Storage","/storage","storage",[120,123],{"title":28,"path":121,"stem":122},"/storage/installation","storage/0.installation",{"title":124,"path":125,"stem":126},"Typescript","/storage/typescript","storage/1.typescript",{"id":128,"title":40,"body":129,"description":197,"extension":200,"links":201,"meta":202,"navigation":203,"path":41,"seo":204,"stem":42,"__hash__":205},"docs/fake-browser/3.reseting-state.md",{"type":130,"value":131,"toc":196},"minimark",[132,136,160,164,171,183,186],[133,134,135],"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:",[137,138,139,147,153],"ol",{},[140,141,142,143],"li",{},"Reset everything: ",[144,145,146],"code",{},"fakeBrowser.reset()",[140,148,149,150],{},"Reset just one API: ",[144,151,152],{},"fakeBrowser.{api}.resetState()",[140,154,155,156,159],{},"Call ",[144,157,158],{},"fakeBrowser.{api}.on{Event}.removeAllListeners()"," to remove all the listeners setup for an event",[161,162,163],"alert",{},"All the reset methods are synchronous",[133,165,166,167,170],{},"For example, to clear the in-memory stored values for ",[144,168,169],{},"browser.storage.local",", you could call any of the following:",[172,173,174,178],"ul",{},[140,175,176],{},[144,177,146],{},[140,179,180],{},[144,181,182],{},"fakeBrowser.storage.resetState()",[133,184,185],{},"All these reset methods should show up in your editor's intellisense.",[161,187,188,189,191,192,195],{},"Generally, you should put a call to ",[144,190,146],{}," in a ",[144,193,194],{},"beforeEach"," block to cleanup the state before every test.",{"title":197,"searchDepth":198,"depth":198,"links":199},"",2,[],"md",null,{},true,{"title":40,"description":197},"Zqy5zgNsjavfhSruS3X8tCHI5XIkz5sYLAjil74Ubpk",[207,208],{"title":36,"path":37,"stem":38,"description":197,"children":-1},{"title":44,"path":45,"stem":46,"description":197,"children":-1},1780345473273]