{"action":"created","issue":{"url":"https://api.github.com/repos/devtools-html/debugger.html/issues/528","repository_url":"https://api.github.com/repos/devtools-html/debugger.html","labels_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/528/labels{/name}","comments_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/528/comments","events_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/528/events","html_url":"https://github.com/devtools-html/debugger.html/pull/528","id":170230589,"number":528,"title":"refactor action unit tests and add a bunch of sources tests","user":{"login":"jlongster","id":17031,"avatar_url":"https://avatars.githubusercontent.com/u/17031?v=3","gravatar_id":"","url":"https://api.github.com/users/jlongster","html_url":"https://github.com/jlongster","followers_url":"https://api.github.com/users/jlongster/followers","following_url":"https://api.github.com/users/jlongster/following{/other_user}","gists_url":"https://api.github.com/users/jlongster/gists{/gist_id}","starred_url":"https://api.github.com/users/jlongster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlongster/subscriptions","organizations_url":"https://api.github.com/users/jlongster/orgs","repos_url":"https://api.github.com/users/jlongster/repos","events_url":"https://api.github.com/users/jlongster/events{/privacy}","received_events_url":"https://api.github.com/users/jlongster/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-09T17:57:47Z","updated_at":"2016-08-10T15:47:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/devtools-html/debugger.html/pulls/528","html_url":"https://github.com/devtools-html/debugger.html/pull/528","diff_url":"https://github.com/devtools-html/debugger.html/pull/528.diff","patch_url":"https://github.com/devtools-html/debugger.html/pull/528.patch"},"body":"This does a few things:\r\n\r\n* It removes `npm run test-paths` because we can implement that with the node test runner, and I fixed that up so it works with the workers and everything\r\n* Consolidates the small test files into files that reflect the action files. So there's just `sources.js` and `breakpoints.js`. This makes it easy to reuse things like mocked thread clients, and I don't see the benefit of splitting everything up. \r\n* Adds a few methods to make testing as simple as possible. No fixtures needed. Just use `makeSource` and manipulate the state (using actions) as you will.\r\n* Adds a bunch of sources tests, particularly sourcemaps (more needed). I got the sourcemaps working under node which is nice.\r\n\r\nI think that's about it. I think we could write a lot of tests this way and cover the majority of our app."},"comment":{"url":"https://api.github.com/repos/devtools-html/debugger.html/issues/comments/238909848","html_url":"https://github.com/devtools-html/debugger.html/pull/528#issuecomment-238909848","issue_url":"https://api.github.com/repos/devtools-html/debugger.html/issues/528","id":238909848,"user":{"login":"jlongster","id":17031,"avatar_url":"https://avatars.githubusercontent.com/u/17031?v=3","gravatar_id":"","url":"https://api.github.com/users/jlongster","html_url":"https://github.com/jlongster","followers_url":"https://api.github.com/users/jlongster/followers","following_url":"https://api.github.com/users/jlongster/following{/other_user}","gists_url":"https://api.github.com/users/jlongster/gists{/gist_id}","starred_url":"https://api.github.com/users/jlongster/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jlongster/subscriptions","organizations_url":"https://api.github.com/users/jlongster/orgs","repos_url":"https://api.github.com/users/jlongster/repos","events_url":"https://api.github.com/users/jlongster/events{/privacy}","received_events_url":"https://api.github.com/users/jlongster/received_events","type":"User","site_admin":false},"created_at":"2016-08-10T15:47:05Z","updated_at":"2016-08-10T15:47:05Z","body":"I renamed the folder to `unit-sources` which is where we can add any arbitrary source text. Right now anything that uses `networkRequest` will pull it from there automatically, but I also plan on making the mocked thread client load from it too so you can literally load them as sources. By creating various kinds of sources we can test all kinds of edge cases.\r\n\r\nI tried to move `restartWorker` to `node-unit-tests`, but it's a little difficult to add a global `afterHook` that has access to it. That file is not a test file, so we'd need to define a global `__restartWorkers` function or something so the global hook can access it, but that also means that we'd be keeping a reference to all workers and restart them automatically, which might not be desired for some workers. So I added a whitelist to only restart ones we care about. But then I realized that none of this will work for karma, so if that's important we just need to manually restart each worker we care about. Might be a better solution that works for both node & karma, but I think we can figure that out later unless you have any easy solutions right now."}}
{"actor":{"display_login":"jlongster"}}