Skip to content

Instantly share code, notes, and snippets.

@phated
Created July 19, 2015 06:05
Show Gist options
  • Select an option

  • Save phated/b16b571d76dea21e8c66 to your computer and use it in GitHub Desktop.

Select an option

Save phated/b16b571d76dea21e8c66 to your computer and use it in GitHub Desktop.
electron tests
it('does window things', function(done){
window.onhashchange = function(){
console.log('change!');
window.onhashchange = undefined;
done();
};
window.location.href = '#change';
});
it('does history things', function(done){
window.onpopstate = function(){
console.log('pop!');
console.log(window.location.href);
done();
};
window.location.href = '/gogogo';
history.back();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment