How to clear local storage in Cypress test?

You can remove this specific key by running:

localStorage.removeItem(‘truste.consent.willistowerswatson.com‘);

Alternatively, if desired, you can delete the entire localStorage as follows:

localStorage.clear();

You also find more info in the MDN Web Docs here: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage