{"action":"created","comment":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/30154569","id":30154569,"diff_hunk":"@@ -0,0 +1,91 @@\n+var appCache = {};\n+\n+module.exports = function (app) {\n+  if(appCache[app]) {\n+    return appCache[app];\n+  }\n+  if(app == 'maze') {\n+    appCache[app] = function() {\n+      return {\n+        skins: require('@cdo/apps/maze/skins'),\n+        levels: {\n+          levels: require('@cdo/apps/maze/levels'),\n+          karelLevels: require('@cdo/apps/maze/karelLevels'),\n+          wordsearchLevels: require('@cdo/apps/maze/wordsearchLevels')\n+        },\n+        blocks: require('@cdo/apps/maze/blocks')\n+      };\n+    };\n+  } else if (app == 'calc') {\n+    appCache[app] = function() {\n+      return {\n+        levels: {\n+          levels: require('@cdo/apps/calc/levels')\n+        },\n+        blocks: require('@cdo/apps/calc/blocks')\n+      };\n+    };\n+  } else if (app == 'flappy') {\n+    appCache[app] = function() {\n+      return {\n+        skins: require('@cdo/apps/flappy/skins'),\n+        levels: {\n+          levels: require('@cdo/apps/flappy/levels')\n+        },\n+        blocks: require('@cdo/apps/flappy/blocks')\n+      };\n+    };\n+  } else if (app == 'turtle') {\n+    appCache[app] = function() {\n+      return {\n+        skins: require('@cdo/apps/turtle/skins'),\n+        levels: {\n+          levels: require('@cdo/apps/turtle/levels')\n+        },\n+        blocks: require('@cdo/apps/turtle/blocks')\n+      };\n+    };\n+  } else if (app == 'eval') {\n+    appCache[app] = function() {\n+      return {\n+        levels: {\n+          levels: require('@cdo/apps/eval/levels')\n+        },\n+        blocks: require('@cdo/apps/eval/blocks')\n+      };\n+    };\n+  } else if (app == 'bounce') {\n+    appCache[app] = function() {\n+      return {\n+        skins: require('@cdo/apps/bounce/skins'),\n+        levels: {\n+          levels: require('@cdo/apps/bounce/levels')\n+        },\n+        blocks: require('@cdo/apps/bounce/blocks')\n+      };\n+    };\n+  } else if (app == 'studio') {\n+    appCache[app] = function() {\n+      return {\n+        skins: require('@cdo/apps/studio/skins'),\n+        levels: {\n+          levels: require('@cdo/apps/studio/levels')\n+        },\n+        blocks: require('@cdo/apps/studio/blocks')\n+      };\n+    };\n+  } else if (app == 'applab') {\n+    appCache[app] = function() {\n+      return {\n+        skins: require('@cdo/apps/applab/skins'),\n+        levels: {\n+          levels: require('@cdo/apps/applab/levels')\n+        },\n+        blocks: require('@cdo/apps/applab/blocks')\n+      };\n+    };\n+  }\n+  if(appCache[app]) {\n+    return appCache[app];\n+  }\n+};","path":"apps/test/util/data.js","position":91,"original_position":91,"commit_id":"53b7b2b78160c532d966152ff2c43e7e3303089f","original_commit_id":"53b7b2b78160c532d966152ff2c43e7e3303089f","user":{"login":"wjordan","id":56541,"avatar_url":"https://avatars.githubusercontent.com/u/56541?v=3","gravatar_id":"","url":"https://api.github.com/users/wjordan","html_url":"https://github.com/wjordan","followers_url":"https://api.github.com/users/wjordan/followers","following_url":"https://api.github.com/users/wjordan/following{/other_user}","gists_url":"https://api.github.com/users/wjordan/gists{/gist_id}","starred_url":"https://api.github.com/users/wjordan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wjordan/subscriptions","organizations_url":"https://api.github.com/users/wjordan/orgs","repos_url":"https://api.github.com/users/wjordan/repos","events_url":"https://api.github.com/users/wjordan/events{/privacy}","received_events_url":"https://api.github.com/users/wjordan/received_events","type":"User","site_admin":false},"body":"Ah, yeah, I forgot I'd left in a form of that workaround for the list of `/main` files. Yeah, it should work similarly, it should be possible to roll everything referenced in this `data.js` file into that require-hack, then just write `require('@cdo/apps/' + app + /levels')`, etc'. It should also be possible to replace that list of `/main` require statements with a single require-glob (I didn't get that working at the time though, for some reason I don't remember now).","created_at":"2015-05-12T16:50:05Z","updated_at":"2015-05-12T16:50:05Z","html_url":"https://github.com/code-dot-org/code-dot-org/pull/2376#discussion_r30154569","pull_request_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/2376","_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments/30154569"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/2376#discussion_r30154569"},"pull_request":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/2376"}}},"pull_request":{"url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/2376","id":35172122,"html_url":"https://github.com/code-dot-org/code-dot-org/pull/2376","diff_url":"https://github.com/code-dot-org/code-dot-org/pull/2376.diff","patch_url":"https://github.com/code-dot-org/code-dot-org/pull/2376.patch","issue_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/2376","number":2376,"state":"open","locked":false,"title":"Test framework","user":{"login":"Bjvanminnen","id":1767466,"avatar_url":"https://avatars.githubusercontent.com/u/1767466?v=3","gravatar_id":"","url":"https://api.github.com/users/Bjvanminnen","html_url":"https://github.com/Bjvanminnen","followers_url":"https://api.github.com/users/Bjvanminnen/followers","following_url":"https://api.github.com/users/Bjvanminnen/following{/other_user}","gists_url":"https://api.github.com/users/Bjvanminnen/gists{/gist_id}","starred_url":"https://api.github.com/users/Bjvanminnen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bjvanminnen/subscriptions","organizations_url":"https://api.github.com/users/Bjvanminnen/orgs","repos_url":"https://api.github.com/users/Bjvanminnen/repos","events_url":"https://api.github.com/users/Bjvanminnen/events{/privacy}","received_events_url":"https://api.github.com/users/Bjvanminnen/received_events","type":"User","site_admin":false},"body":"Move our tests to run browserified code in phantomjs.\r\n\r\nFor more details see http://wiki.code.org/display/PROD/mocha+tests\r\n\r\nMost of these changes are around dealing with locales differently.\r\n\r\nThere are also still some TODO's in here. The most interesting two are tests that have been disabled (one that checks for infinite recursion, another is a class of tests where we make sure we get the right required blocks for incorrect solutions).","created_at":"2015-05-11T21:35:06Z","updated_at":"2015-05-12T16:50:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4800c1c91ff39ace638ba0355f69c6fd1890909f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/2376/commits","review_comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/2376/comments","review_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/2376/comments","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/53b7b2b78160c532d966152ff2c43e7e3303089f","head":{"label":"code-dot-org:testFramework","ref":"testFramework","sha":"53b7b2b78160c532d966152ff2c43e7e3303089f","user":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"name":"code-dot-org","full_name":"code-dot-org/code-dot-org","owner":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","created_at":"2014-09-20T00:46:11Z","updated_at":"2015-05-10T02:32:09Z","pushed_at":"2015-05-12T16:16:49Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":2049441,"stargazers_count":37,"watchers_count":37,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":12,"forks":25,"open_issues":12,"watchers":37,"default_branch":"staging"}},"base":{"label":"code-dot-org:staging","ref":"staging","sha":"f705c4a0efc60ddb01976e8749a8918da17e0658","user":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"repo":{"id":24250009,"name":"code-dot-org","full_name":"code-dot-org/code-dot-org","owner":{"login":"code-dot-org","id":5124627,"avatar_url":"https://avatars.githubusercontent.com/u/5124627?v=3","gravatar_id":"","url":"https://api.github.com/users/code-dot-org","html_url":"https://github.com/code-dot-org","followers_url":"https://api.github.com/users/code-dot-org/followers","following_url":"https://api.github.com/users/code-dot-org/following{/other_user}","gists_url":"https://api.github.com/users/code-dot-org/gists{/gist_id}","starred_url":"https://api.github.com/users/code-dot-org/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/code-dot-org/subscriptions","organizations_url":"https://api.github.com/users/code-dot-org/orgs","repos_url":"https://api.github.com/users/code-dot-org/repos","events_url":"https://api.github.com/users/code-dot-org/events{/privacy}","received_events_url":"https://api.github.com/users/code-dot-org/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/code-dot-org/code-dot-org","description":"The code powering code.org and studio.code.org","fork":false,"url":"https://api.github.com/repos/code-dot-org/code-dot-org","forks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/forks","keys_url":"https://api.github.com/repos/code-dot-org/code-dot-org/keys{/key_id}","collaborators_url":"https://api.github.com/repos/code-dot-org/code-dot-org/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/code-dot-org/code-dot-org/teams","hooks_url":"https://api.github.com/repos/code-dot-org/code-dot-org/hooks","issue_events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/events{/number}","events_url":"https://api.github.com/repos/code-dot-org/code-dot-org/events","assignees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/assignees{/user}","branches_url":"https://api.github.com/repos/code-dot-org/code-dot-org/branches{/branch}","tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/tags","blobs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/refs{/sha}","trees_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/trees{/sha}","statuses_url":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/{sha}","languages_url":"https://api.github.com/repos/code-dot-org/code-dot-org/languages","stargazers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/stargazers","contributors_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contributors","subscribers_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscribers","subscription_url":"https://api.github.com/repos/code-dot-org/code-dot-org/subscription","commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/commits{/sha}","git_commits_url":"https://api.github.com/repos/code-dot-org/code-dot-org/git/commits{/sha}","comments_url":"https://api.github.com/repos/code-dot-org/code-dot-org/comments{/number}","issue_comment_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/comments{/number}","contents_url":"https://api.github.com/repos/code-dot-org/code-dot-org/contents/{+path}","compare_url":"https://api.github.com/repos/code-dot-org/code-dot-org/compare/{base}...{head}","merges_url":"https://api.github.com/repos/code-dot-org/code-dot-org/merges","archive_url":"https://api.github.com/repos/code-dot-org/code-dot-org/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/code-dot-org/code-dot-org/downloads","issues_url":"https://api.github.com/repos/code-dot-org/code-dot-org/issues{/number}","pulls_url":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls{/number}","milestones_url":"https://api.github.com/repos/code-dot-org/code-dot-org/milestones{/number}","notifications_url":"https://api.github.com/repos/code-dot-org/code-dot-org/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/code-dot-org/code-dot-org/labels{/name}","releases_url":"https://api.github.com/repos/code-dot-org/code-dot-org/releases{/id}","created_at":"2014-09-20T00:46:11Z","updated_at":"2015-05-10T02:32:09Z","pushed_at":"2015-05-12T16:16:49Z","git_url":"git://github.com/code-dot-org/code-dot-org.git","ssh_url":"git@github.com:code-dot-org/code-dot-org.git","clone_url":"https://github.com/code-dot-org/code-dot-org.git","svn_url":"https://github.com/code-dot-org/code-dot-org","homepage":"http://code.org","size":2049441,"stargazers_count":37,"watchers_count":37,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":12,"forks":25,"open_issues":12,"watchers":37,"default_branch":"staging"}},"_links":{"self":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/2376"},"html":{"href":"https://github.com/code-dot-org/code-dot-org/pull/2376"},"issue":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/2376"},"comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/issues/2376/comments"},"review_comments":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/2376/comments"},"review_comment":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/pulls/2376/commits"},"statuses":{"href":"https://api.github.com/repos/code-dot-org/code-dot-org/statuses/53b7b2b78160c532d966152ff2c43e7e3303089f"}}}}