{"action":"created","comment":{"url":"https://api.github.com/repos/mozilla/web-ext/pulls/comments/82464967","pull_request_review_id":3370614,"id":82464967,"diff_hunk":"@@ -37,6 +63,103 @@ describe('build', () => {\n     );\n   });\n \n+  it('gives the correct name to a localized extension', () => {\n+    return withTempDir(\n+      (tmpDir) =>\n+        build({\n+          sourceDir: fixturePath('minimal-localizable-web-ext'),\n+          artifactsDir: tmpDir.path(),\n+        })\n+        .then((buildResult) => {\n+          assert.match(buildResult.extensionPath,\n+                       /name_of_the_extension-1\\.0\\.zip$/);\n+          return buildResult.extensionPath;\n+        })\n+    );\n+  });\n+\n+  it('gives the correct name to a localized' +\n+    'extension with repeating pattern in manifest', () => {\n+    return withTempDir(\n+      (tmpDir) => {\n+        const messageFileName = path.join(tmpDir.path(), 'messages.json');\n+        //This is missing the 'message' key\n+        fs.writeFileSync(messageFileName,\n+          `{\"extensionName\": {\n+              \"message\": \"example extension\",\n+              \"description\": \"example extension\"\n+            }\n+          }`);\n+        return getDefaultLocalizedName({\n+          messageFile: messageFileName,\n+          manifestData: basicLocalizedManifestWithRepeatingPattern,\n+        })\n+          .then((result) => {\n+            assert.match(result, /example extensionexample extension/);\n+          });\n+      }\n+    );\n+  });\n+\n+  it('checks locale file for malformed json', () => {\n+    return withTempDir(\n+      (tmpDir) => {\n+        const messageFileName = path.join(tmpDir.path(), 'messages.json');\n+        fs.writeFileSync(messageFileName,\n+          '{\"simulated:\" \"json syntax error\"');\n+        return getDefaultLocalizedName({\n+          messageFile: messageFileName,\n+          manifestData: manifestWithoutApps,\n+        })\n+          .then(makeSureItFails())\n+          .catch((error) => {\n+            assert.instanceOf(error, WebExtError);\n+            assert.match(\n+              error.message,\n+              /The JSON file is malformed: SyntaxError: Unexpected string/);\n+          });\n+      }\n+    );\n+  });\n+\n+  it('checks locale file for incorrect format', () => {\n+    return withTempDir(\n+      (tmpDir) => {\n+        const messageFileName = path.join(tmpDir.path(), 'messages.json');\n+        //This is missing the 'message' key\n+        fs.writeFileSync(messageFileName,\n+          `{\"extensionName\": {\n+              \"description\": \"example extension\"\n+              }\n+          }`);\n+        return getDefaultLocalizedName({\n+          messageFile: messageFileName,\n+          manifestData: basicLocalizedManifest,\n+        })\n+          .then(makeSureItFails())\n+          .catch((error) => {\n+            assert.instanceOf(error, WebExtError);\n+            assert.match(\n+              error.message,\n+              /The locale file .*messages\\.json .* key: extensionName/);\n+          });\n+      }\n+    );\n+  });\n+\n+  it('throws an error if the locale file doesn\\'t exist', () => {","path":"tests/unit/test-cmd/test.build.js","position":128,"original_position":128,"commit_id":"474ffc707226bef3248b075c927e158bc207b6a2","original_commit_id":"474ffc707226bef3248b075c927e158bc207b6a2","user":{"login":"kumar303","id":55398,"avatar_url":"https://avatars.githubusercontent.com/u/55398?v=3","gravatar_id":"","url":"https://api.github.com/users/kumar303","html_url":"https://github.com/kumar303","followers_url":"https://api.github.com/users/kumar303/followers","following_url":"https://api.github.com/users/kumar303/following{/other_user}","gists_url":"https://api.github.com/users/kumar303/gists{/gist_id}","starred_url":"https://api.github.com/users/kumar303/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kumar303/subscriptions","organizations_url":"https://api.github.com/users/kumar303/orgs","repos_url":"https://api.github.com/users/kumar303/repos","events_url":"https://api.github.com/users/kumar303/events{/privacy}","received_events_url":"https://api.github.com/users/kumar303/received_events","type":"User","site_admin":false},"body":"you could cheat and say `does not` to avoid an escaped apostrophe :)","created_at":"2016-10-07T20:33:04Z","updated_at":"2016-10-07T20:33:04Z","html_url":"https://github.com/mozilla/web-ext/pull/487#discussion_r82464967","pull_request_url":"https://api.github.com/repos/mozilla/web-ext/pulls/487","_links":{"self":{"href":"https://api.github.com/repos/mozilla/web-ext/pulls/comments/82464967"},"html":{"href":"https://github.com/mozilla/web-ext/pull/487#discussion_r82464967"},"pull_request":{"href":"https://api.github.com/repos/mozilla/web-ext/pulls/487"}}},"pull_request":{"url":"https://api.github.com/repos/mozilla/web-ext/pulls/487","id":85313802,"html_url":"https://github.com/mozilla/web-ext/pull/487","diff_url":"https://github.com/mozilla/web-ext/pull/487.diff","patch_url":"https://github.com/mozilla/web-ext/pull/487.patch","issue_url":"https://api.github.com/repos/mozilla/web-ext/issues/487","number":487,"state":"open","locked":false,"title":"fix: Building an XPI with only localizations makes an ugly file name","user":{"login":"shubheksha","id":7693422,"avatar_url":"https://avatars.githubusercontent.com/u/7693422?v=3","gravatar_id":"","url":"https://api.github.com/users/shubheksha","html_url":"https://github.com/shubheksha","followers_url":"https://api.github.com/users/shubheksha/followers","following_url":"https://api.github.com/users/shubheksha/following{/other_user}","gists_url":"https://api.github.com/users/shubheksha/gists{/gist_id}","starred_url":"https://api.github.com/users/shubheksha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shubheksha/subscriptions","organizations_url":"https://api.github.com/users/shubheksha/orgs","repos_url":"https://api.github.com/users/shubheksha/repos","events_url":"https://api.github.com/users/shubheksha/events{/privacy}","received_events_url":"https://api.github.com/users/shubheksha/received_events","type":"User","site_admin":false},"body":"A possible fix for #198","created_at":"2016-09-14T22:04:02Z","updated_at":"2016-10-07T20:36:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c2593aa093ae038a2f607e39428318b50bf96ff4","assignee":{"login":"kumar303","id":55398,"avatar_url":"https://avatars.githubusercontent.com/u/55398?v=3","gravatar_id":"","url":"https://api.github.com/users/kumar303","html_url":"https://github.com/kumar303","followers_url":"https://api.github.com/users/kumar303/followers","following_url":"https://api.github.com/users/kumar303/following{/other_user}","gists_url":"https://api.github.com/users/kumar303/gists{/gist_id}","starred_url":"https://api.github.com/users/kumar303/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kumar303/subscriptions","organizations_url":"https://api.github.com/users/kumar303/orgs","repos_url":"https://api.github.com/users/kumar303/repos","events_url":"https://api.github.com/users/kumar303/events{/privacy}","received_events_url":"https://api.github.com/users/kumar303/received_events","type":"User","site_admin":false},"assignees":[{"login":"kumar303","id":55398,"avatar_url":"https://avatars.githubusercontent.com/u/55398?v=3","gravatar_id":"","url":"https://api.github.com/users/kumar303","html_url":"https://github.com/kumar303","followers_url":"https://api.github.com/users/kumar303/followers","following_url":"https://api.github.com/users/kumar303/following{/other_user}","gists_url":"https://api.github.com/users/kumar303/gists{/gist_id}","starred_url":"https://api.github.com/users/kumar303/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kumar303/subscriptions","organizations_url":"https://api.github.com/users/kumar303/orgs","repos_url":"https://api.github.com/users/kumar303/repos","events_url":"https://api.github.com/users/kumar303/events{/privacy}","received_events_url":"https://api.github.com/users/kumar303/received_events","type":"User","site_admin":false}],"milestone":null,"commits_url":"https://api.github.com/repos/mozilla/web-ext/pulls/487/commits","review_comments_url":"https://api.github.com/repos/mozilla/web-ext/pulls/487/comments","review_comment_url":"https://api.github.com/repos/mozilla/web-ext/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mozilla/web-ext/issues/487/comments","statuses_url":"https://api.github.com/repos/mozilla/web-ext/statuses/474ffc707226bef3248b075c927e158bc207b6a2","head":{"label":"shubheksha:fix/198","ref":"fix/198","sha":"474ffc707226bef3248b075c927e158bc207b6a2","user":{"login":"shubheksha","id":7693422,"avatar_url":"https://avatars.githubusercontent.com/u/7693422?v=3","gravatar_id":"","url":"https://api.github.com/users/shubheksha","html_url":"https://github.com/shubheksha","followers_url":"https://api.github.com/users/shubheksha/followers","following_url":"https://api.github.com/users/shubheksha/following{/other_user}","gists_url":"https://api.github.com/users/shubheksha/gists{/gist_id}","starred_url":"https://api.github.com/users/shubheksha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shubheksha/subscriptions","organizations_url":"https://api.github.com/users/shubheksha/orgs","repos_url":"https://api.github.com/users/shubheksha/repos","events_url":"https://api.github.com/users/shubheksha/events{/privacy}","received_events_url":"https://api.github.com/users/shubheksha/received_events","type":"User","site_admin":false},"repo":{"id":65824381,"name":"web-ext","full_name":"shubheksha/web-ext","owner":{"login":"shubheksha","id":7693422,"avatar_url":"https://avatars.githubusercontent.com/u/7693422?v=3","gravatar_id":"","url":"https://api.github.com/users/shubheksha","html_url":"https://github.com/shubheksha","followers_url":"https://api.github.com/users/shubheksha/followers","following_url":"https://api.github.com/users/shubheksha/following{/other_user}","gists_url":"https://api.github.com/users/shubheksha/gists{/gist_id}","starred_url":"https://api.github.com/users/shubheksha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/shubheksha/subscriptions","organizations_url":"https://api.github.com/users/shubheksha/orgs","repos_url":"https://api.github.com/users/shubheksha/repos","events_url":"https://api.github.com/users/shubheksha/events{/privacy}","received_events_url":"https://api.github.com/users/shubheksha/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/shubheksha/web-ext","description":"A command line tool to help build, run, and test web extensions","fork":true,"url":"https://api.github.com/repos/shubheksha/web-ext","forks_url":"https://api.github.com/repos/shubheksha/web-ext/forks","keys_url":"https://api.github.com/repos/shubheksha/web-ext/keys{/key_id}","collaborators_url":"https://api.github.com/repos/shubheksha/web-ext/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/shubheksha/web-ext/teams","hooks_url":"https://api.github.com/repos/shubheksha/web-ext/hooks","issue_events_url":"https://api.github.com/repos/shubheksha/web-ext/issues/events{/number}","events_url":"https://api.github.com/repos/shubheksha/web-ext/events","assignees_url":"https://api.github.com/repos/shubheksha/web-ext/assignees{/user}","branches_url":"https://api.github.com/repos/shubheksha/web-ext/branches{/branch}","tags_url":"https://api.github.com/repos/shubheksha/web-ext/tags","blobs_url":"https://api.github.com/repos/shubheksha/web-ext/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/shubheksha/web-ext/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/shubheksha/web-ext/git/refs{/sha}","trees_url":"https://api.github.com/repos/shubheksha/web-ext/git/trees{/sha}","statuses_url":"https://api.github.com/repos/shubheksha/web-ext/statuses/{sha}","languages_url":"https://api.github.com/repos/shubheksha/web-ext/languages","stargazers_url":"https://api.github.com/repos/shubheksha/web-ext/stargazers","contributors_url":"https://api.github.com/repos/shubheksha/web-ext/contributors","subscribers_url":"https://api.github.com/repos/shubheksha/web-ext/subscribers","subscription_url":"https://api.github.com/repos/shubheksha/web-ext/subscription","commits_url":"https://api.github.com/repos/shubheksha/web-ext/commits{/sha}","git_commits_url":"https://api.github.com/repos/shubheksha/web-ext/git/commits{/sha}","comments_url":"https://api.github.com/repos/shubheksha/web-ext/comments{/number}","issue_comment_url":"https://api.github.com/repos/shubheksha/web-ext/issues/comments{/number}","contents_url":"https://api.github.com/repos/shubheksha/web-ext/contents/{+path}","compare_url":"https://api.github.com/repos/shubheksha/web-ext/compare/{base}...{head}","merges_url":"https://api.github.com/repos/shubheksha/web-ext/merges","archive_url":"https://api.github.com/repos/shubheksha/web-ext/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/shubheksha/web-ext/downloads","issues_url":"https://api.github.com/repos/shubheksha/web-ext/issues{/number}","pulls_url":"https://api.github.com/repos/shubheksha/web-ext/pulls{/number}","milestones_url":"https://api.github.com/repos/shubheksha/web-ext/milestones{/number}","notifications_url":"https://api.github.com/repos/shubheksha/web-ext/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/shubheksha/web-ext/labels{/name}","releases_url":"https://api.github.com/repos/shubheksha/web-ext/releases{/id}","deployments_url":"https://api.github.com/repos/shubheksha/web-ext/deployments","created_at":"2016-08-16T13:52:30Z","updated_at":"2016-09-24T18:43:02Z","pushed_at":"2016-10-07T19:58:24Z","git_url":"git://github.com/shubheksha/web-ext.git","ssh_url":"git@github.com:shubheksha/web-ext.git","clone_url":"https://github.com/shubheksha/web-ext.git","svn_url":"https://github.com/shubheksha/web-ext","homepage":null,"size":532,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"mozilla:master","ref":"master","sha":"d0954a968e59f568bacd6ae8027bc79e3f9773d3","user":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"repo":{"id":50859563,"name":"web-ext","full_name":"mozilla/web-ext","owner":{"login":"mozilla","id":131524,"avatar_url":"https://avatars.githubusercontent.com/u/131524?v=3","gravatar_id":"","url":"https://api.github.com/users/mozilla","html_url":"https://github.com/mozilla","followers_url":"https://api.github.com/users/mozilla/followers","following_url":"https://api.github.com/users/mozilla/following{/other_user}","gists_url":"https://api.github.com/users/mozilla/gists{/gist_id}","starred_url":"https://api.github.com/users/mozilla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mozilla/subscriptions","organizations_url":"https://api.github.com/users/mozilla/orgs","repos_url":"https://api.github.com/users/mozilla/repos","events_url":"https://api.github.com/users/mozilla/events{/privacy}","received_events_url":"https://api.github.com/users/mozilla/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mozilla/web-ext","description":"A command line tool to help build, run, and test web extensions","fork":false,"url":"https://api.github.com/repos/mozilla/web-ext","forks_url":"https://api.github.com/repos/mozilla/web-ext/forks","keys_url":"https://api.github.com/repos/mozilla/web-ext/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mozilla/web-ext/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mozilla/web-ext/teams","hooks_url":"https://api.github.com/repos/mozilla/web-ext/hooks","issue_events_url":"https://api.github.com/repos/mozilla/web-ext/issues/events{/number}","events_url":"https://api.github.com/repos/mozilla/web-ext/events","assignees_url":"https://api.github.com/repos/mozilla/web-ext/assignees{/user}","branches_url":"https://api.github.com/repos/mozilla/web-ext/branches{/branch}","tags_url":"https://api.github.com/repos/mozilla/web-ext/tags","blobs_url":"https://api.github.com/repos/mozilla/web-ext/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mozilla/web-ext/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mozilla/web-ext/git/refs{/sha}","trees_url":"https://api.github.com/repos/mozilla/web-ext/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mozilla/web-ext/statuses/{sha}","languages_url":"https://api.github.com/repos/mozilla/web-ext/languages","stargazers_url":"https://api.github.com/repos/mozilla/web-ext/stargazers","contributors_url":"https://api.github.com/repos/mozilla/web-ext/contributors","subscribers_url":"https://api.github.com/repos/mozilla/web-ext/subscribers","subscription_url":"https://api.github.com/repos/mozilla/web-ext/subscription","commits_url":"https://api.github.com/repos/mozilla/web-ext/commits{/sha}","git_commits_url":"https://api.github.com/repos/mozilla/web-ext/git/commits{/sha}","comments_url":"https://api.github.com/repos/mozilla/web-ext/comments{/number}","issue_comment_url":"https://api.github.com/repos/mozilla/web-ext/issues/comments{/number}","contents_url":"https://api.github.com/repos/mozilla/web-ext/contents/{+path}","compare_url":"https://api.github.com/repos/mozilla/web-ext/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mozilla/web-ext/merges","archive_url":"https://api.github.com/repos/mozilla/web-ext/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mozilla/web-ext/downloads","issues_url":"https://api.github.com/repos/mozilla/web-ext/issues{/number}","pulls_url":"https://api.github.com/repos/mozilla/web-ext/pulls{/number}","milestones_url":"https://api.github.com/repos/mozilla/web-ext/milestones{/number}","notifications_url":"https://api.github.com/repos/mozilla/web-ext/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mozilla/web-ext/labels{/name}","releases_url":"https://api.github.com/repos/mozilla/web-ext/releases{/id}","deployments_url":"https://api.github.com/repos/mozilla/web-ext/deployments","created_at":"2016-02-01T18:08:32Z","updated_at":"2016-10-04T05:21:00Z","pushed_at":"2016-10-07T19:57:55Z","git_url":"git://github.com/mozilla/web-ext.git","ssh_url":"git@github.com:mozilla/web-ext.git","clone_url":"https://github.com/mozilla/web-ext.git","svn_url":"https://github.com/mozilla/web-ext","homepage":null,"size":709,"stargazers_count":80,"watchers_count":80,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":57,"forks":39,"open_issues":57,"watchers":80,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mozilla/web-ext/pulls/487"},"html":{"href":"https://github.com/mozilla/web-ext/pull/487"},"issue":{"href":"https://api.github.com/repos/mozilla/web-ext/issues/487"},"comments":{"href":"https://api.github.com/repos/mozilla/web-ext/issues/487/comments"},"review_comments":{"href":"https://api.github.com/repos/mozilla/web-ext/pulls/487/comments"},"review_comment":{"href":"https://api.github.com/repos/mozilla/web-ext/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mozilla/web-ext/pulls/487/commits"},"statuses":{"href":"https://api.github.com/repos/mozilla/web-ext/statuses/474ffc707226bef3248b075c927e158bc207b6a2"}}}}
{"actor":{"display_login":"kumar303"}}