{"action":"opened","number":9,"pull_request":{"url":"https://api.github.com/repos/TheLudd/mocha-gwt/pulls/9","id":46064533,"html_url":"https://github.com/TheLudd/mocha-gwt/pull/9","diff_url":"https://github.com/TheLudd/mocha-gwt/pull/9.diff","patch_url":"https://github.com/TheLudd/mocha-gwt/pull/9.patch","issue_url":"https://api.github.com/repos/TheLudd/mocha-gwt/issues/9","number":9,"state":"open","locked":false,"title":"Browserify","user":{"login":"jasonkarns","id":119972,"avatar_url":"https://avatars.githubusercontent.com/u/119972?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonkarns","html_url":"https://github.com/jasonkarns","followers_url":"https://api.github.com/users/jasonkarns/followers","following_url":"https://api.github.com/users/jasonkarns/following{/other_user}","gists_url":"https://api.github.com/users/jasonkarns/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonkarns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonkarns/subscriptions","organizations_url":"https://api.github.com/users/jasonkarns/orgs","repos_url":"https://api.github.com/users/jasonkarns/repos","events_url":"https://api.github.com/users/jasonkarns/events{/privacy}","received_events_url":"https://api.github.com/users/jasonkarns/received_events","type":"User","site_admin":false},"body":"# do not merge\r\n\r\nThere are multiple components to this PR, and some of them will be extracted as separate PRs (since some changes aren't specific to browser functionality)\r\n\r\n- the ui methods should be attached to the provided suite context, not `global` (this can be a separate PR. it is a standalone change)\r\n- the `pre-require` and `post-require` events are given a `null` value for `file` when invoked in the browser, so a default dummy value of `'browser'` is used\r\n- the `processedFiles.length` guard will not work in the browser since `mocha.files` will be empty. However, I'm not sure of the purpose of this guard in node, so some alternative is necessary before this can be merged. For now, I've simply removed the guard and allowed each `processedFile` to be built into a mocha suite.\r\n- this PR requires that the `post-require` hook be invoked manually just prior to `mocha.run()`. For my testing, I have configured this manually, but I now have an [open PR to Mocha](https://github.com/mochajs/mocha/pull/1905) which will do this automatically in the browser-distribution of mocha\r\n- browserify is required and configured via an npm script (`npm run build`) which drops the browser-build under `/dist` (this dist file will either need to be included in the npm tarball on prepublish, or committed in github, or published to github as a release asset. I can configure another PR that does this automatically whenever a new version is released)\r\n- coffeeify transform is configured for browserify to compile coffee into JS during the build step\r\n- browserify-shim transform is included such that the `require('mocha')` call is replaced with a `window.Mocha` shim. It should be assumed that if mocha-gwt is being used in the browser that mocha is included like a regular script and exists as the global `Mocha` (which is [indeed what is done in the browser distribution](https://github.com/mochajs/mocha/blob/c4393c456839d6bf2cbb4abb1cd177010ee06458/support/browser-entry.js#L160) of mocha)\r\n","created_at":"2015-09-25T22:24:03Z","updated_at":"2015-09-25T22:24:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/TheLudd/mocha-gwt/pulls/9/commits","review_comments_url":"https://api.github.com/repos/TheLudd/mocha-gwt/pulls/9/comments","review_comment_url":"https://api.github.com/repos/TheLudd/mocha-gwt/pulls/comments{/number}","comments_url":"https://api.github.com/repos/TheLudd/mocha-gwt/issues/9/comments","statuses_url":"https://api.github.com/repos/TheLudd/mocha-gwt/statuses/c109190e3b3ac8cdde5c1da7980b94ca68368e99","head":{"label":"jasonkarns:browserify","ref":"browserify","sha":"c109190e3b3ac8cdde5c1da7980b94ca68368e99","user":{"login":"jasonkarns","id":119972,"avatar_url":"https://avatars.githubusercontent.com/u/119972?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonkarns","html_url":"https://github.com/jasonkarns","followers_url":"https://api.github.com/users/jasonkarns/followers","following_url":"https://api.github.com/users/jasonkarns/following{/other_user}","gists_url":"https://api.github.com/users/jasonkarns/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonkarns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonkarns/subscriptions","organizations_url":"https://api.github.com/users/jasonkarns/orgs","repos_url":"https://api.github.com/users/jasonkarns/repos","events_url":"https://api.github.com/users/jasonkarns/events{/privacy}","received_events_url":"https://api.github.com/users/jasonkarns/received_events","type":"User","site_admin":false},"repo":{"id":43177903,"name":"mocha-gwt","full_name":"jasonkarns/mocha-gwt","owner":{"login":"jasonkarns","id":119972,"avatar_url":"https://avatars.githubusercontent.com/u/119972?v=3","gravatar_id":"","url":"https://api.github.com/users/jasonkarns","html_url":"https://github.com/jasonkarns","followers_url":"https://api.github.com/users/jasonkarns/followers","following_url":"https://api.github.com/users/jasonkarns/following{/other_user}","gists_url":"https://api.github.com/users/jasonkarns/gists{/gist_id}","starred_url":"https://api.github.com/users/jasonkarns/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jasonkarns/subscriptions","organizations_url":"https://api.github.com/users/jasonkarns/orgs","repos_url":"https://api.github.com/users/jasonkarns/repos","events_url":"https://api.github.com/users/jasonkarns/events{/privacy}","received_events_url":"https://api.github.com/users/jasonkarns/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jasonkarns/mocha-gwt","description":"Given When Then for mocha","fork":true,"url":"https://api.github.com/repos/jasonkarns/mocha-gwt","forks_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/forks","keys_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/teams","hooks_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/hooks","issue_events_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/issues/events{/number}","events_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/events","assignees_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/assignees{/user}","branches_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/branches{/branch}","tags_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/tags","blobs_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/git/refs{/sha}","trees_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/statuses/{sha}","languages_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/languages","stargazers_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/stargazers","contributors_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/contributors","subscribers_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/subscribers","subscription_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/subscription","commits_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/commits{/sha}","git_commits_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/git/commits{/sha}","comments_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/comments{/number}","issue_comment_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/issues/comments{/number}","contents_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/contents/{+path}","compare_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/merges","archive_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/downloads","issues_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/issues{/number}","pulls_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/pulls{/number}","milestones_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/milestones{/number}","notifications_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/labels{/name}","releases_url":"https://api.github.com/repos/jasonkarns/mocha-gwt/releases{/id}","created_at":"2015-09-25T22:13:16Z","updated_at":"2015-09-25T22:13:17Z","pushed_at":"2015-09-25T22:13:28Z","git_url":"git://github.com/jasonkarns/mocha-gwt.git","ssh_url":"git@github.com:jasonkarns/mocha-gwt.git","clone_url":"https://github.com/jasonkarns/mocha-gwt.git","svn_url":"https://github.com/jasonkarns/mocha-gwt","homepage":null,"size":300,"stargazers_count":0,"watchers_count":0,"language":"CoffeeScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"TheLudd:master","ref":"master","sha":"fd6dc5eea7fc7dbda0ac03ebad63926090c61e94","user":{"login":"TheLudd","id":557295,"avatar_url":"https://avatars.githubusercontent.com/u/557295?v=3","gravatar_id":"","url":"https://api.github.com/users/TheLudd","html_url":"https://github.com/TheLudd","followers_url":"https://api.github.com/users/TheLudd/followers","following_url":"https://api.github.com/users/TheLudd/following{/other_user}","gists_url":"https://api.github.com/users/TheLudd/gists{/gist_id}","starred_url":"https://api.github.com/users/TheLudd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheLudd/subscriptions","organizations_url":"https://api.github.com/users/TheLudd/orgs","repos_url":"https://api.github.com/users/TheLudd/repos","events_url":"https://api.github.com/users/TheLudd/events{/privacy}","received_events_url":"https://api.github.com/users/TheLudd/received_events","type":"User","site_admin":false},"repo":{"id":25297604,"name":"mocha-gwt","full_name":"TheLudd/mocha-gwt","owner":{"login":"TheLudd","id":557295,"avatar_url":"https://avatars.githubusercontent.com/u/557295?v=3","gravatar_id":"","url":"https://api.github.com/users/TheLudd","html_url":"https://github.com/TheLudd","followers_url":"https://api.github.com/users/TheLudd/followers","following_url":"https://api.github.com/users/TheLudd/following{/other_user}","gists_url":"https://api.github.com/users/TheLudd/gists{/gist_id}","starred_url":"https://api.github.com/users/TheLudd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TheLudd/subscriptions","organizations_url":"https://api.github.com/users/TheLudd/orgs","repos_url":"https://api.github.com/users/TheLudd/repos","events_url":"https://api.github.com/users/TheLudd/events{/privacy}","received_events_url":"https://api.github.com/users/TheLudd/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/TheLudd/mocha-gwt","description":"Given When Then for mocha","fork":false,"url":"https://api.github.com/repos/TheLudd/mocha-gwt","forks_url":"https://api.github.com/repos/TheLudd/mocha-gwt/forks","keys_url":"https://api.github.com/repos/TheLudd/mocha-gwt/keys{/key_id}","collaborators_url":"https://api.github.com/repos/TheLudd/mocha-gwt/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/TheLudd/mocha-gwt/teams","hooks_url":"https://api.github.com/repos/TheLudd/mocha-gwt/hooks","issue_events_url":"https://api.github.com/repos/TheLudd/mocha-gwt/issues/events{/number}","events_url":"https://api.github.com/repos/TheLudd/mocha-gwt/events","assignees_url":"https://api.github.com/repos/TheLudd/mocha-gwt/assignees{/user}","branches_url":"https://api.github.com/repos/TheLudd/mocha-gwt/branches{/branch}","tags_url":"https://api.github.com/repos/TheLudd/mocha-gwt/tags","blobs_url":"https://api.github.com/repos/TheLudd/mocha-gwt/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/TheLudd/mocha-gwt/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/TheLudd/mocha-gwt/git/refs{/sha}","trees_url":"https://api.github.com/repos/TheLudd/mocha-gwt/git/trees{/sha}","statuses_url":"https://api.github.com/repos/TheLudd/mocha-gwt/statuses/{sha}","languages_url":"https://api.github.com/repos/TheLudd/mocha-gwt/languages","stargazers_url":"https://api.github.com/repos/TheLudd/mocha-gwt/stargazers","contributors_url":"https://api.github.com/repos/TheLudd/mocha-gwt/contributors","subscribers_url":"https://api.github.com/repos/TheLudd/mocha-gwt/subscribers","subscription_url":"https://api.github.com/repos/TheLudd/mocha-gwt/subscription","commits_url":"https://api.github.com/repos/TheLudd/mocha-gwt/commits{/sha}","git_commits_url":"https://api.github.com/repos/TheLudd/mocha-gwt/git/commits{/sha}","comments_url":"https://api.github.com/repos/TheLudd/mocha-gwt/comments{/number}","issue_comment_url":"https://api.github.com/repos/TheLudd/mocha-gwt/issues/comments{/number}","contents_url":"https://api.github.com/repos/TheLudd/mocha-gwt/contents/{+path}","compare_url":"https://api.github.com/repos/TheLudd/mocha-gwt/compare/{base}...{head}","merges_url":"https://api.github.com/repos/TheLudd/mocha-gwt/merges","archive_url":"https://api.github.com/repos/TheLudd/mocha-gwt/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/TheLudd/mocha-gwt/downloads","issues_url":"https://api.github.com/repos/TheLudd/mocha-gwt/issues{/number}","pulls_url":"https://api.github.com/repos/TheLudd/mocha-gwt/pulls{/number}","milestones_url":"https://api.github.com/repos/TheLudd/mocha-gwt/milestones{/number}","notifications_url":"https://api.github.com/repos/TheLudd/mocha-gwt/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/TheLudd/mocha-gwt/labels{/name}","releases_url":"https://api.github.com/repos/TheLudd/mocha-gwt/releases{/id}","created_at":"2014-10-16T10:37:43Z","updated_at":"2015-03-03T22:46:39Z","pushed_at":"2015-09-25T22:24:03Z","git_url":"git://github.com/TheLudd/mocha-gwt.git","ssh_url":"git@github.com:TheLudd/mocha-gwt.git","clone_url":"https://github.com/TheLudd/mocha-gwt.git","svn_url":"https://github.com/TheLudd/mocha-gwt","homepage":null,"size":300,"stargazers_count":2,"watchers_count":2,"language":"CoffeeScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":3,"forks":2,"open_issues":3,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/TheLudd/mocha-gwt/pulls/9"},"html":{"href":"https://github.com/TheLudd/mocha-gwt/pull/9"},"issue":{"href":"https://api.github.com/repos/TheLudd/mocha-gwt/issues/9"},"comments":{"href":"https://api.github.com/repos/TheLudd/mocha-gwt/issues/9/comments"},"review_comments":{"href":"https://api.github.com/repos/TheLudd/mocha-gwt/pulls/9/comments"},"review_comment":{"href":"https://api.github.com/repos/TheLudd/mocha-gwt/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/TheLudd/mocha-gwt/pulls/9/commits"},"statuses":{"href":"https://api.github.com/repos/TheLudd/mocha-gwt/statuses/c109190e3b3ac8cdde5c1da7980b94ca68368e99"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":10,"additions":41,"deletions":25,"changed_files":2}}