Is it possible to combine a custom command which gets trigger in both beforeEach & afterEach hooks? I'm currently using the cypress-localstorage-commands plugin like so:
beforeEach(() => {
cy.restoreLocalStorage();
});
afterEach(() => {
cy.saveLocalStorage();
});
Is there a way to abstract this into a custom command so I don't need to add these hooks or reuse this code in each spec file?