Not possible to use feature detection of onhashchange in jsdom 7.2.1 like so:
if ("onhashchange" in window) {
console.log("The browser supports the hashchange event!");
}
The message does not print from the code above. However, this is my work-a-round for now:
// HACK: When in a browser, the default value for onhashchange is null, but jsdom sets it to undefined.
window.onhashchange = null;
if ("onhashchange" in window) {
console.log("The browser supports the hashchange event!");
}