Skip to content

Instantly share code, notes, and snippets.

@jeremygpeterson
Created November 5, 2011 19:15
Show Gist options
  • Save jeremygpeterson/1341898 to your computer and use it in GitHub Desktop.
Save jeremygpeterson/1341898 to your computer and use it in GitHub Desktop.
Simplify testing Backbone.js with Jasmine
// Global storing the Window's HREF and Title
var LocationHREF = window.location.href,
DocumentTitle = document.title;
afterEach(function () {
// Restore State back, only when needed
if (window.location.href != LocationHREF) {
window.history.pushState({}, DocumentTitle, LocationHREF);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment