{"action":"created","issue":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/1466","repository_url":"https://api.github.com/repos/lhorie/mithril.js","labels_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1466/labels{/name}","comments_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1466/comments","events_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1466/events","html_url":"https://github.com/lhorie/mithril.js/pull/1466","id":194039360,"number":1466,"title":"[rewrite] (WIP) A few more tests for the router + mock fixes","user":{"login":"pygy","id":54515,"avatar_url":"https://avatars.githubusercontent.com/u/54515?v=3","gravatar_id":"","url":"https://api.github.com/users/pygy","html_url":"https://github.com/pygy","followers_url":"https://api.github.com/users/pygy/followers","following_url":"https://api.github.com/users/pygy/following{/other_user}","gists_url":"https://api.github.com/users/pygy/gists{/gist_id}","starred_url":"https://api.github.com/users/pygy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pygy/subscriptions","organizations_url":"https://api.github.com/users/pygy/orgs","repos_url":"https://api.github.com/users/pygy/repos","events_url":"https://api.github.com/users/pygy/events{/privacy}","received_events_url":"https://api.github.com/users/pygy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-07T12:40:06Z","updated_at":"2016-12-07T14:42:23Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/lhorie/mithril.js/pulls/1466","html_url":"https://github.com/lhorie/mithril.js/pull/1466","diff_url":"https://github.com/lhorie/mithril.js/pull/1466.diff","patch_url":"https://github.com/lhorie/mithril.js/pull/1466.patch"},"body":"I was adding tests and noticed that the mocks were inadequate to write them... Pushing one commit at a time for CI confirmation.\r\n\r\nThe description will be fleshed out once the router tests are pushed.\r\n\r\n----\r\n\r\nEdit... I had to rebase it, so much for individual CI reports...\r\n\r\nSo for the mocks, it turns out that the `pushState` functions didn't have a reference to `$window` in the `browserMock` because of how the latter was being built. This is now fixed. I found other mock bugs, but the fix require more extensive investigation, I'll open other issues.\r\n\r\nWhen redirecting from `onmatch` if you replace \r\n`m.route.set('/foo')` \r\nwith \r\n`callAsync(_ => m.route.set('/foo'))`\r\nor\r\n`$window.history.back()`,\r\n`update` fires unless you return a pending promise. I've added inline `return new Promise(function(){})` for now, but it would be nice to provide a proper API for that."},"comment":{"url":"https://api.github.com/repos/lhorie/mithril.js/issues/comments/265464252","html_url":"https://github.com/lhorie/mithril.js/pull/1466#issuecomment-265464252","issue_url":"https://api.github.com/repos/lhorie/mithril.js/issues/1466","id":265464252,"user":{"login":"pygy","id":54515,"avatar_url":"https://avatars.githubusercontent.com/u/54515?v=3","gravatar_id":"","url":"https://api.github.com/users/pygy","html_url":"https://github.com/pygy","followers_url":"https://api.github.com/users/pygy/followers","following_url":"https://api.github.com/users/pygy/following{/other_user}","gists_url":"https://api.github.com/users/pygy/gists{/gist_id}","starred_url":"https://api.github.com/users/pygy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pygy/subscriptions","organizations_url":"https://api.github.com/users/pygy/orgs","repos_url":"https://api.github.com/users/pygy/repos","events_url":"https://api.github.com/users/pygy/events{/privacy}","received_events_url":"https://api.github.com/users/pygy/received_events","type":"User","site_admin":false},"created_at":"2016-12-07T14:42:23Z","updated_at":"2016-12-07T14:42:23Z","body":"> `callAsync(() => m.route.set('/foo'))` should fire update imho.\r\n\r\nWhy? Suppose you want to perform some async logic before redirecting, how do you prevent update from firing?"}}
{"actor":{"display_login":"pygy"}}